http://www.perlmonks.org?node_id=11142352

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

if ($ARGV[0] ne "") { $destdir = $ARGV[0]; } else { if (exists $ENV{'LOGS_EV'}) { $destdir = $ENV{'LOGS_EV'}; } else { colored_printout(RED,"\nERROR: Environment variable LOGS_EV not +defined!"); } }

Here the above code prints the statement in the last else loop like "ERROR: Environment variable LOGS_EV not defined!". But i want the code to store the some value in the $destdir for this what changes can i do.