perlanswers has asked for the wisdom of the Perl Monks concerning the following question:
./html.pl -root="/home/data/multiple/" -out="/home/data/output" -file= +"/home/data/file.txt"
use strict; use warnings; use Getopt::Long qw(GetOptions); sub usage { if (@_) { my ($msg) = @_; chomp($msg); print(STDERR "$msg\n"); } GetOptions( 'root=s' => \my $dir, 'out=s' => \my $out, 'file=s' => \my $file, ) or usage();
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: how to write script usage sub routine for the perl file? the dynamic duo with Pod::Usage
by Discipulus (Canon) on Apr 03, 2017 at 07:54 UTC | |
|
Re: how to write script usage sub routine for the perl file?
by huck (Prior) on Apr 03, 2017 at 06:35 UTC | |
by marto (Cardinal) on Apr 03, 2017 at 08:27 UTC | |
by LanX (Saint) on Apr 03, 2017 at 09:18 UTC | |
|
Re: how to write script usage sub routine for the perl file?
by Anonymous Monk on Apr 03, 2017 at 05:52 UTC | |
|