in reply to Help with references
OK, my new code stands as follows:
#!/path/to/perl -w use strict; my @array1 = (0..9); my @array2 = ('a'..'l'); my (@a1, @a2) = g(\@array1, \@array2); print "\@a1 = @a1\n"; print "\@a2 = @a2\n"; sub g { print "sub g\n"; my @a1 = @{(shift)}; my @a2 = @{(shift)}; print "$_ " for @a1; print "\n"; print "$_ " for @a2; print "\n"; return (@a1, @a2); }
Anyway to make the global @a2 not empty when I'm done?
Oh, and thank you both.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Help with references
by Anonymous Monk on Jul 01, 2004 at 18:10 UTC | |
by sgifford (Prior) on Jul 01, 2004 at 18:54 UTC | |
by Anonymous Monk on Jul 01, 2004 at 19:26 UTC | |
by thor (Priest) on Jul 01, 2004 at 20:44 UTC | |
by sgifford (Prior) on Jul 02, 2004 at 15:25 UTC |