in reply to Re^3: How to test for empty hash?
in thread How to test for empty hash?
Impressive analysis!
It doesn't surprise me there are subtle differences. I only mentioned secret operators for some light relief, and (unlike BooK ;), would never inflict the inchworm secret operator on my workmates in production code ... my rule number one at work being "Correctness, simplicity and clarity come first. Avoid unnecessary cleverness".
Curiously, your second example seems to be fixed by adding use integer:
$ perl -le 'print ~~$#foo' 18446744073709551615 $ perl -Minteger -le 'print ~~$#foo' -1
... which reminds me of this recent reply by BillKSmith ... while typing -Minteger from the command line just now reminded me of chromatic's comical -Modern::Perl command line hack. :)
Update: See also: the "Inchworm" and "Inchworm on a stick" sections at perlsecret and The Lighter Side of Perl Culture (Part IV): Golf (search for inchworm).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: How to test for empty hash?
by haukex (Archbishop) on Aug 08, 2021 at 18:30 UTC |