in reply to passing files with

It is hard to say what problem you are having. I'll make a guess that you are doing:

script.pl <infile.txt
on a Windows platform and the script doesn't appear to read the contents of the "infile.txt" file. If this is indeed your problem, then you have run into a bug in how Microsoft does "file associations", that is, how Microsoft knows to run Perl when you ask it to run a file whose name ends in ".pl".

A quick solution is to instead use:

perl script.pl <infile.txt

You can type the command:

perldoc pl2bat
to view the documentation for the pl2bat script. It includes more information about this problem and ways to solve it along with the trade-offs of the different solutions (unless you have an old version of Perl that doesn't include my patches for this).

        - tye (but my friends call me "Tye")