http://qs321.pair.com?node_id=664713


in reply to input from STDIN or from a file

I don't know how complex your program would be, but I usually just use,
$ cat file.txt a b c $ cat stdin.pl #!/usr/bin/perl -l while (<>) { $_ = uc; print; } $ perl stdin.pl file.txt A B C $ cat file.txt | perl stdin.pl A B C
Or, just perl -lpe '$_=uc' if it's really that simple. Anyway, I don't see anything wrong with your code.

Update: Fixed missing -l (only the dash was there). Thanks almut :-)


Open source softwares? Share and enjoy. Make profit from them if you can. Yet, share and enjoy!