Created
November 19, 2013 16:22
-
-
Save AndrewRussellHayes/7547982 to your computer and use it in GitHub Desktop.
messing around with passing a perl array by reference
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@arr = qw(1 2 3 4 5 6 7 8 9 10); | |
use Data::Dumper; | |
#print Dumper(@arr); | |
printme(1,2,\@arr,4); | |
sub printme | |
{ | |
$varone = $_[0]; | |
$vartwo = $_[1]; | |
@varthree = @{$_[2]}; | |
$varfour = $_[3]; | |
print "$varone\n"; | |
print "$vartwo\n"; | |
print "dumper: ".Dumper($_[3])."\n"; | |
print "foreach: "; | |
foreach $item (@varthree) | |
{ | |
# print "line\n"; | |
print "item $item\n" | |
} | |
print "\n$varfour\n"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment