in reply to process file via command line

you are probably looking for something like the -n or -p option. Like
perl -ni.bak -e 'stuff' input_file
There is a good reference as to the use of these perlrun in the documentation.

-enlil