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.";
In reply to Re: Passing reference to subroutine
by Narveson
in thread Passing reference to subroutine
by iphony
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |