in reply to output redirection when calling perl from shell - perl -pe "blabla"

I suspect you made the (not unreasonable) assumption that the script was producing no output because the output file /tmp/xx was empty.

Due to the way that output redirection is handled by the shell, the output file is created regardless of whether there is any actual output.

You can use this behaviour to your advantage to quickly create an empty file. Here's an example:

$ ls -l redirect_out ls: cannot access redirect_out: No such file or directory $ > redirect_out $ ls -l redirect_out -rw-r--r-- 1 ken None 0 Oct 16 14:50 redirect_out

-- Ken