Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re^5: Two meanings of undef (updated)by AnomalousMonk (Archbishop) |
on Aug 16, 2020 at 03:28 UTC ( [id://11120802]=note: print w/replies, xml ) | Need Help?? |
There's a distinction between %main:: (the symbol table of the main package, i.e., namespace) and the two hashes %main and %main::main (which are two different ways of naming the same hash!) in the main package. (Note: warnings are enabled, strictures disabled.) The statement say X; creates an unopened filehandle X in the main package which exists and is defined, although useless. The hash elements $main{X} and $main::main{X} (again, two different names for the same thing) do not exist and are not defined. Update 1: A few minor wording changes.
Update 2: The difference and equivalence among the two separate hashes running around in this example code can be highlighted by inserting the Give a man a fish: <%-{-{-{-<
In Section
Seekers of Perl Wisdom
|
|