programming-examples/perl/Subroutine/Return reference from a function.pl
2019-11-15 12:59:38 +01:00

18 lines
239 B
Perl

#!/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" );