Think about Loose Coupling | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Thanks for the kind words. The my trick is an old one that relies on a feature of my that is not documented in perldoc -f my (though my is so ubiquitous that I suspect many people have not even read that perldoc). You see, my, like most Perl functions, has a return value. It returns variable it's declaring. That allows you to do stuff like this:
You can also use it to assign values to more than one variable: perl -MData::Dumper -e 'my @a = my ($x,$y,$z) = localtime;print Dumper \@a'In short, were it not for this feature, Perl would lose many nifty timesavers. Cheers, New address of my CGI Course. In reply to Re(2): What Is 'my' Interested In?
by Ovid
|
|