echo "foo bar" |perl -wE'for () { print "$. $_" }' 2 foo 2 bar