I get:#!/usr/bin/perl use strict; use warnings; my $x; $x = $x+1; print $x;
Then try:Use of uninitialized value in addition (+) at tmp.pl line 6.
to see the difference...#!/usr/bin/perl use strict; use warnings; my $x; $x = $x ? $x+1 : 1; print $x;
cLive ;-)
In reply to Re^3: Refactoring: dumb or witty use of ternary operator?
by cLive ;-)
in thread Refactoring: dumb or witty use of ternary operator?
by PetaMem
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |