Is the following the best way to check if a scalar variable is initialized in Perl, using defined?
defined
my $var; if (cond) { $var = \"string1\";
If you don't care whether or not it's empty, it is. Otherwise you can check
if ( length( $str || '' )) {}