What you want is GetOpt::Long. It will handle all your command line option needs.
In reply to Re: join this by myocom in thread splitting command-line arguments by IraTarball