in reply to Remove '>' from email

I think you will need to show us how you're running the program. My guess is that you're trying to run your program as follows:

perl -w 672099.pl <mymail.txt >mymail.txt

Running any program like that will always clobber the file, because that's how the shell works. It first creates all output files and then reads from all input files. But your output and input file are the same.

To see that Perl is not the problem, run your program without output redirection.

Replies are listed 'Best First'.
Re^2: Remove '>' from email
by ikegami (Patriarch) on Mar 05, 2008 at 07:02 UTC
    Solutions:
    672099.pl <mymail.txt >mymail.txt.new && mv mymail.txt.new mymail.txt
    or
    perl -i 672099.pl mymail.txt