E
Ela
I am declaring the following variables at the beginning:
@usage='cg.pl afile gfile ffile outname gensf genqcf genpf';
die "Usage: @usage\n" if $#ARGV < @usage;
my ($afile, $gfile, $ffile, $outname, $gensf, $genqcf, $genpf);
I have 2 more questions here, the first, instead of copying the @usage to
the my(), how can I better write the codes to avoid typo and work? I will
use exactly the same name indeed and don't know how many more I will add. I
don't like config file because it usually makes program no longer work after
a period of maintenance (config file gets lost etc).
The second question is, how to allow the user input the arguments without
restricting them in a specific order? e.g. gfile ahead of afile...?
I find that some of the arguments are necessary, while some others, such as
flags, may be optional. How can I write it in a better way to check whether
all the necessary arguments are provided instead of fixing $#ARGV < @usage?
@usage='cg.pl afile gfile ffile outname gensf genqcf genpf';
die "Usage: @usage\n" if $#ARGV < @usage;
my ($afile, $gfile, $ffile, $outname, $gensf, $genqcf, $genpf);
I have 2 more questions here, the first, instead of copying the @usage to
the my(), how can I better write the codes to avoid typo and work? I will
use exactly the same name indeed and don't know how many more I will add. I
don't like config file because it usually makes program no longer work after
a period of maintenance (config file gets lost etc).
The second question is, how to allow the user input the arguments without
restricting them in a specific order? e.g. gfile ahead of afile...?
I find that some of the arguments are necessary, while some others, such as
flags, may be optional. How can I write it in a better way to check whether
all the necessary arguments are provided instead of fixing $#ARGV < @usage?