How to write a Perl script to convert file to all upper case? -


how can write perl script convert text file upper case letters?

perl -ne "print uc" < input.txt 

the -n wraps command line script (which supplied -e) in while loop. uc returns all-uppercase version of default variable $_, , print does, well, know yourself. ;-)

the -p -n, print in addition. again, acting on default variable $_.

to store in script file:

#!perl -n print uc; 

call this:

perl uc.pl < in.txt > out.txt 

Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -