Comment on Perlsecret – Perl secret operators and constantsparentComments−shawn_w8moYou're not using `integer` in the perl example like you're supposed to. Try perl -Minteger -E 'say ~-0' and it should work as expected.−omoikane8moThat is true, but for the kind of code where I might use this trick, there usually aren't enough `~-$x` for `use integer;` to be worthwhile, I would just do `($x-1)` instead.
Comments
You're not using `integer` in the perl example like you're supposed to. Try
and it should work as expected.That is true, but for the kind of code where I might use this trick, there usually aren't enough `~-$x` for `use integer;` to be worthwhile, I would just do `($x-1)` instead.