One small bug: shift shifts from @_ by default, not @ARGV - you'll need to explictly specify @ARGV to read command line parameters.