The most amazing achievement of the computer software industry is its continuing cancellation of the steady and staggering gains made by the computer hardware industry.
The inchworm on a stick may do something, but since it duplicates a standard operator, pre-decrement, it isn't very useful.
Your choices are
$b = --$a;
Which is documented in the manual, so everyone should know what it means, and the cryptic and arcane
$b = ~-$a;
I suppose if you enjoy proving your superiority by doing things no one knows, you'll prefer the second. Personally, I prefer to not have my sleep interrupted at 3 am by someone wanting an explanation of weird code in a program that stopped working. There are enough useful and valid Perl idioms that beginners don't know, no need to add an unneccessary one.
I am being sponsored by Syntress! They bought me an amazing dedicated server to run catonmat on. If you're looking web services, I highly recommend the Syntress guys!
The inchworm on a stick may do something, but since it duplicates a standard operator, pre-decrement, it isn't very useful.
Your choices are
$b = --$a;
Which is documented in the manual, so everyone should know what it means, and the cryptic and arcane
$b = ~-$a;
I suppose if you enjoy proving your superiority by doing things no one knows, you'll prefer the second. Personally, I prefer to not have my sleep interrupted at 3 am by someone wanting an explanation of weird code in a program that stopped working. There are enough useful and valid Perl idioms that beginners don't know, no need to add an unneccessary one.
Reply To This Comment