programming-examples/perl/Subroutine/Return reference from a function.pl

18 lines
239 B
Perl
Raw Normal View History

2019-11-15 12:59:38 +01:00
#!/usr/bin/perl
use strict;
use warnings;
my @array = qw( A B C D E );
my $arrayReference = \@array;
sub returnReference
{
return \@array;
}
print( "\${returnReference()}[ 1 ] = ${returnReference()}[ 1 ]\n\n" );