Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: In my perl code i am getting some other output instead of Other

by graff (Chancellor)
on Mar 25, 2022 at 00:31 UTC ( [id://11142397]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11142397]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (6)
As of 2024-04-19 14:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found