| [reply] |
&mumble(\@foo);
Now the code inside mumble can modify elements inside @foo:sub mumble {
my ($bar) = @_;
...
$bar->[1]++; #increments second member of array
}
But what does Data::Dumper do?
Data::Dumper is a useful module that reverse engineers perl data structures into human readable perl code. To reconstruct the data structures, this can be done with an eval - this is one of many ways to do persistence in Perl.
Further reading: perldoc perlsub gives more on subroutines and parameter passing. The Camel book: "Programming Perl" is an invaluable reference. Also, Sriram Srivanam's "Advanced Perl Programming" has an excellent chapter on references. | [reply] [d/l] [select] |