in reply to Passing reference to subroutine
By the time you say
print "\nThere are @{$two} items in Two.";your $two has gone out of scope. Move this print statement inside the sub, and you will get
There are 5 6 7 8 items in Two.which will lead you to say something like
my $count = scalar @{$two}; print "\nThere are $count items in Two.";
|
|---|