in reply to Re^2: Refactoring: dumb or witty use of ternary operator?
in thread Refactoring: dumb or witty use of ternary operator?
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 ;-)
|
|---|