Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

Re: sending a file to a perl script

by dimmesdale (Friar)
on Aug 09, 2002 at 14:34 UTC ( [id://188919] : note . print w/replies, xml ) Need Help??

in reply to sending a file to a perl script

Well just call the program like:

perl FileToAddSuffixTo

and the code can simply be:

... my $file = $ARGV[0]; ...

@ARGV is the special perl variable that holds the argument vector.

If all you're doing is changing the suffix (and not any reformatting, etc.), then might I suggest just renaming the file with the given .doc extension? If you're using windows you can just right click and go to rename (or the rename command in MS-DOS), and under UNIX, the 'mv' command would do it, I believe.