$num = shift @ARGV; while (<>) { ... process data ... }