in reply to Using getopt::Long

only few things to add: read this very good old node (i discoverd it yesterday..) because if you are doing the effort to use GetOpt::Long, may be easy and usefull add automatical help and man to your program, bringing it to a superior usability and durability.

Also be sure to read the above mentioned docs because, being that module very powerfull, it can sometimes surpise you.
In fact, as you are using a sub to be tricked by argouments and options, maybe you have to know that GetOpt::Long is consuming @ARGV during the GetOptions call or the fact that you can still have somethng in @ARGV using the double dash --

Hth
L*
There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.