programming-examples/perl/Subroutine/Passing References to a Subroutine.pl
2019-11-15 12:59:38 +01:00

11 lines
153 B
Perl

#!/usr/bin/perl
use warnings;
use strict;
my $a = 5;
increment(\$a);
print $a;
sub increment {
my $reference = shift;
$$reference++;
}