[Brisbane-pm] Passing Refs into a Sub ctd...
Jacinta Richardson
jarich at perltraining.com.au
Mon Feb 26 16:18:02 PST 2007
I know that it's hard. It looks like you're almost there at least. :)
> Again, I would appreciate any comments.
Looks good to me. Just one little thing. Remember that instead of this:
my $new_i = change_everything (
arg1 => $i, #$i is a variable (which is a scalar in this case)
arg2 => \@j, #\@j is a reference to @j
arg3 => \@k, #\@k is a reference to @k
arg4 => \%l, #\%l is a reference to %l
);
#Take a look at the output
print 'Testprint line 68 $new_i = ' . "$new_i\n";
You can instead re-assign to $i if you want to:
$i = change_everything (
arg1 => $i, #$i is a variable (which is a scalar in this case)
arg2 => \@j, #\@j is a reference to @j
arg3 => \@k, #\@k is a reference to @k
arg4 => \%l, #\%l is a reference to %l
);
#Take a look at the output
print 'Testprint line 68 $i = ' . "$i\n";
If you have any questions about how this is working, or if you want me/us to
review any code you take from this, please feel free to speak up.
J
--
("`-''-/").___..--''"`-._ | Jacinta Richardson |
`6_ 6 ) `-. ( ).`-.__.`) | Perl Training Australia |
(_Y_.)' ._ ) `._ `. ``-..-' | +61 3 9354 6001 |
_..`--'_..-_/ /--'_.' ,' | contact at perltraining.com.au |
(il),-'' (li),' ((!.-' | www.perltraining.com.au |
More information about the Brisbane-pm
mailing list