in reply to Re: Breaking The Rules
in thread Breaking The Rules
is there really any benifit to writing...(snip)...other than to avoid the warnings?
Yes, the former is more clear in its intent, the latter is a longer and more obfuscated way of writing print $var unless $var eq '' (update: and even that may as well be just print $var ...printing an empty string shouldn't make a difference anyway...though I assume this is just a simple example and you could have, e.g., print "blah blah $foo blah" unless defined $foo)
|
---|