in reply to formatting usage statements with $0
use File::Basename; my $prog = basename($0); sub print_usage { warn <<"EOF"; USAGE $prog [options] file DESCRIPTION Whatever this program should do. OPTIONS -h Print this help message -o dir Dump output file to specifed directory OPERANDS file A path name of an input file. FILES An output file is written to the current directory. The name of the file is foo. EXAMPLES $prog -o bar in.txt $prog -h EXIT STATUS 0 Successful completion >0 An error occurred EOF }
|
|---|