in reply to testing defined($x) && length($x)

Given that the test will fail if either $x is undefined or is defined but is empty, you could avoid the uninitialized value... warning by using
if (length($x || '')) { ... }

A user level that continues to overstate my experience :-))

Replies are listed 'Best First'.
Re^2: testing defined($x) && length($x)
by ikegami (Patriarch) on Mar 25, 2009 at 15:50 UTC
    That introduces a false negative. The if's body is no longer executed when $x eq '0'.