Scripting >> Perl >> How to pass array reference to a subroutine

my @myarray = ("one","two","three"); listitems(\@myarray); sub listitems() { my $theirarrayref = shift; my @theirarray = @{$theirarrayref}; foreach $item (@theirarray) { print "$item\n"; } return 0 }