I've seen valid reasons for using '$dummy' rather than 'undef', but not in this example.
I can't remember if it was specifically a MacPerl thing, but there were some older versions where you couldn't cast undef with my, so when I'd be working with tab delim files, I'd do stuff like:
my ($foo, $bar, $undef, $undef, $baz) = split (/\t/, $line);
As the following would throw errors:
my ($foo, $bar, undef, undef, $baz) = split (/\t/, $line);
It's not a problem any longer, and the example given declares the variables in the lines before, so it wouldn't have been an issue. I'd assume that either the person was learning perl by looking at other people's old code, or had learned a while back, and hadn't kept up with the changes in the language.
| [reply] [d/l] [select] |
Intersting, the undef doc doesn't mention that behaviour, maybe a hint to perldata would be apropriate there.
| [reply] |