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:
chomp(my $data = <FH>); while ((my $foo = some_func()) eq 'bar') { ... }
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,
Ovid
New address of my CGI Course.
In reply to Re(2): What Is 'my' Interested In?
by Ovid
in thread What Are Your Live Journal Friends Interested In?
by Ovid
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |