Have you looked at the Getopt::Long module? It does what you want (and more, but...).
In reply to Re: command line switches (array) by Corion in thread command line switches (array) by blackice69