in reply to Script help

Those @ARGVs in the subs should be @_ .. @ARGV are just the arguments to the script itself, which you have killed using shift in that while at the end.

C.