iphony has asked for the wisdom of the Perl Monks concerning the following question:
my @apple = (1,2,3,4); my @pear = (5,6,7,8); &test(\@apple, \@pear); sub test () { my ($one, $two) = @_; foreach ( @{$one} ) { print "\n$_"; } print "\n========================"; foreach ( @{$two} ) { print "\n$_"; } } print "\nThere are @{$two} items in Two."; print "\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Passing reference to subroutine
by ikegami (Patriarch) on Oct 03, 2008 at 06:29 UTC | |
|
Re: Passing reference to subroutine
by Narveson (Chaplain) on Oct 03, 2008 at 06:32 UTC | |
|
Re: Passing reference to subroutine
by kubrat (Scribe) on Oct 03, 2008 at 09:02 UTC | |
|
Re: Passing reference to subroutine
by aukjan (Friar) on Oct 03, 2008 at 06:33 UTC | |
|
Re: Passing reference to subroutine
by Skeeve (Parson) on Oct 03, 2008 at 06:31 UTC |