in reply to specifying numeric values for scalar variables with $ARGV

Use:
while (<INPUT>)
instead of
while (<>)
<> is in this case the same as <ARGV> - and you know what is in there, yes? :)
You have moved into a dark place.
It is pitch black. You are likely to be eaten by a grue.