Your perfectly working script is very scary and needlessly convoluted. But to answer your question: open a file, read its lines into an array, make sure the values are chomped and use that array instead of @ARGV (or cheat and put everything in @ARGV directly).
I think the easiest way to do this is by using simple oneliners. Under unixish systems (where \r is always just CR), I use:
andperl -i -pe's/\r//' file file ... # do-to-unix
Or, no, this is not the easiest way. The easiest way is to use the dos2unix and unix2dos tools.perl -i -pe's/$/\r/' file file ... # unix-to-dos
Juerd # { site => 'juerd.nl', plp_site => 'plp.juerd.nl', do_not_use => 'spamtrap' }
In reply to Re: Another dos to unix question
by Juerd
in thread Another dos to unix question
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |