You could just add an exit–
print "help is called - Help Panel:\n"; exit;
I’d recommend looking at Pod::Usage instead of trying to roll this kind of thing though. Working stub–
# File named "my-script-name.pl" to match Pod. use strict; use warnings; use Getopt::Long; use Pod::Usage; my $ok = GetOptions( help => \my $help, task => \my $do_something ); pod2usage( -verbose => 0 ) unless $ok; pod2usage( -verbose => 2 ) if $help; print "Doing... ", $do_something ? "something or other\n" : "NOTHING!\n"; __DATA__ =head1 Synopsis my-script-name.pl -help my-script-name.pl -task =head1 License WTFPL (NSFW!). =cut
In reply to Re: PERL - newbie: first time working with GetOptions error given when running script
by Your Mother
in thread PERL - newbie: first time working with GetOptions error given when running script
by lshokri02
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |