*foo is that stash (imagine lots of hand waving here).
When you later to keys %foo, Perl first goes hunting in the PAD for a lexical hash, if not found, it looks in the stash. In the variant you're doing my %foo, Perl will take the one from the PAD, which is empty. Without the my %foo Perl finds the %foo you want.
Could someone please explain why the "my" version is good enough to make Perl happy while still returning an unexpected result?If you mean by "making Perl happy", "strict doesn't throw an exception", do realize that strict isn't an magic bullet. Strict is like having a car whose motor will not start if your door isn't closed, and your seat belts aren't locked when turning the key. Warnings are the beeping sounds your car will make as soon as you drive above 55 miles per hour. Neither of them prevents you from running full speed into a tree, or ending up in the Bronx while your intention is to go to Vegas.
In reply to Re: typeglob & my | our
by JavaFan
in thread typeglob & my | our
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |