Just another Perl shrine | |
PerlMonks |
Questions about curious idiom seen in packageby SimonSaysCake (Beadle) |
on Feb 17, 2019 at 23:41 UTC ( [id://1230054]=perlquestion: print w/replies, xml ) | Need Help?? |
SimonSaysCake has asked for the wisdom of the Perl Monks concerning the following question: We use a package where I work, "WebService::NetSuite", and I happened to be looking at the code recently and noticed a very odd idiom being used: undef my $hash_ref;It's seems pretty clear that is't not a typo (unless it's the result of a bad cross-file seach-and-replace) as it is used in 16 different places across two files within that package. Noteworthy is that it is only used when initializing but not also assigning new variables (in those cases the author just issues EG: my $super_epoch = time() * 1000;which is what you'd expect). I scanned all other packages in my Strawberry install and found no other packages where this is used. My questions are, does this leading "undef" really do anything? If so, what exactly? Thanks to anyone that can shed light/offer insight. -s1m0n-
Back to
Seekers of Perl Wisdom
|
|