|
|
| Don't ask to ask, just ask | |
| PerlMonks |
Barewords with unary operators (was: Problem with perlcritic...)by haj (Vicar) |
| on Oct 06, 2018 at 19:47 UTC ( [id://1223624]=note: print w/replies, xml ) | Need Help?? |
|
(regarding $hashref->{-option})
Interestingly, the former is actually interpreted as an expression (note the "negate" below),... Thanks for providing another interesting insight! We've moved pretty far from the original issue, so I've modified the title... and I allow myself to add some stuff I found while experimenting with bareword stringification (and, just for fun, abusing some not directly related pitfalls into which I fell some time ago). Warning: This isn't to be taken too seriously. Read on at your own risk. Consider the following code: This prints:
The resulting hash %h has five keys, and the function f has been called five times. Before going into the boring stuff, see the following code, which is equivalent... well, almost: ...which prints...
This time I've used "fat comma" stringification which got me the same keys, but only three calls to function f. So, these are the questions:
I always wanted to test that Perlmonks' spoiler element, so here it is: <Reveal this spoiler or all in this thread>
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||