in reply to Parsing the command line: manual or module?

By its very own words and form it shows that this small piece of script is already buggy!
# first argument is a -f; collect it and ignore it for now my $optionalArgument = shift;
  1. If one knows that the first argument is always -f why collect and save it? It is always there, so deal with it and don't force your users to type unnecessary arguments!
  2. If this argument is always there, why is it then called $optionalArgument?
  3. If the argument is really optional, shifting the non existing optional argument will really screw up your code!
So the question is not "How could this code be buggy?" but "How could this code be not buggy?"

CountZero

"If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law