in reply to In my perl code i am getting some other output instead of Other

When writing a script for command-line use, I try to make it easy for the user to get enough information about the expected / allowed args and options. Given your very limited example, I would tend to do it like this:
my $usage = "Usage: $0 [path]\n default: value of env.variable LOGS_EV +\n"; my $destdir; if ( @ARGV ) { $destdir = $ARGV[0]; } elsif ( $ENV{'LOGS_EV'} ) { $destdir = $ENV{'LOGS_EV'} } else { warn "Please supply a path or set LOGS_EV\n\n"; die $usage; }
  • Comment on Re: In my perl code i am getting some other output instead of Other
  • Download Code