You have 3 arguments, so $#ARGV is 2, your if is false and nothing gets printed
But that's beside the point, you really should use either Getopt::Std or Getopt::Long, two modules that take care of command line arguments for you. Maybe you haven't used a module yet, this is the perfect time to use your first one. It's easy and both modules are already included in any normal perl distribution, so you should have them ready for use
Getopt::Std is the simpler module, but you have to check for yourself that at least one of the options was specified, Getopt::Long is more complex, but there you can specify whether options are optional or required.
In reply to Re: How to make sure to print usage when the options are not entered?
by jethro
in thread How to make sure to print usage when the options are not entered?
by perl_mystery
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |