In a message dated 3/7/2004 6:58:57 AM Eastern Standard Time, [EMAIL PROTECTED] writes: >This is quite a common and simple problem for which reading the whole >perldoc perlsub might be somewhat too confusing, but asking about it on >mailing lists usually starts discussions which often become arguments on >whose favorite style is better, so I'll do my best to describe every >possible way as objectively as I can, and then I'll say which style I >would personally use in which circumstances.
Very nice. Thank you for posting it. You do bring up a very good point that references may not be what you want. References have a lot of significance and value, and sometimes they don't do what you want them to do. If, for (a very simplistic) example my $a = 2; chref(\$a); sub chref { my $ref = shift; $$ref = 3; } will modify the value of $a, which may not be what you want. And saving the value of complex data structures isn't the most enjoyable thing in the world. (I'd compare it to for chemistry making your own test tubes for every single experiment. Thank God for the Clone module however.) So, my only advice to the OP is if you're going to use references, know how to use them, and what they do. In the problem you presented, they're not entirely necessary (unless you WANT to modify the array's value). Your discussion was very well written and informative. Thanks again. -will (the above message is double rot13 encoded for security reasons) Most Useful Perl Modules -strict -warnings -Devel::DProf -Benchmark -B::Deparse -Data::Dumper -Clone (a Godsend) -Perl::Tidy -Beautifier -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>