J
Johhny
Hello,
I am in the process of learning perl. On my perl quest I am trying to
learn getops. How do I make it so that if I type the command for
example
../perl_script.pl
without any additional flags it will automatically show the help or a
title saying what it does.
Currently I have something like this
==SNIP==
sub get_options()
{
use Getopt::Std;
my $opt_string = 'hvdf:';
getopts( "$opt_string", \%opt ) or usage();
usage() if $opt{h};
}
==SNIP==
Any assistance would be greatly appreciated.
I am in the process of learning perl. On my perl quest I am trying to
learn getops. How do I make it so that if I type the command for
example
../perl_script.pl
without any additional flags it will automatically show the help or a
title saying what it does.
Currently I have something like this
==SNIP==
sub get_options()
{
use Getopt::Std;
my $opt_string = 'hvdf:';
getopts( "$opt_string", \%opt ) or usage();
usage() if $opt{h};
}
==SNIP==
Any assistance would be greatly appreciated.