In addition to the previous comments, using for var in `cat file` is usually wrong. The file will not only be split by newlines, but by other symbols (defined in shell variable IFS; spaces, newlines and tabs by default) too. If you need similar behaviour, you need perl -lpe 'join "\n",split/[\t ]/' file. EDIT: fixed code
Sorry if my advice was wrong.
Comment on Re: Bash for loop variable pass equivalent in perl
And to get perl's default line-by-line behavior in the shell, set IFS to a newline (The ctrl-V ctrl-J sequence inserts a raw newline into the command without ending it):
$ IFS="^V^J
"; for i in `cat file`; do echo aaa $i; done