T
TonyShirt
#I'm Trying to traverse an array slice that has been passed to a sub
#I'm not sure what perl is doing when I set the reference to @_
$Slice[1]=["a","b","c"];
$Slice[2]=["d","e","f"];
printslice(\@Slice);
sub printslice{
@tempslice = @_;
foreach my $x (@tempslice){
foreach ($w,$y,$z){
print $w."\n";
}
}
}
#I would like the output to be the first value in the slice i.e.:
#a
#d
#Could any one help?
#I'm not sure what perl is doing when I set the reference to @_
$Slice[1]=["a","b","c"];
$Slice[2]=["d","e","f"];
printslice(\@Slice);
sub printslice{
@tempslice = @_;
foreach my $x (@tempslice){
foreach ($w,$y,$z){
print $w."\n";
}
}
}
#I would like the output to be the first value in the slice i.e.:
#a
#d
#Could any one help?