perl -wE '/^\s*(\d+)\s*$/ and say "num: $1" for @ARGV' test 2 3 4 foo bar 7