In case anyone else was following this, and for the search purposes in the archives, 
with the help on this list and the perldocs, I completed my program.


#!usr/bin/perl

# This program will change an original file(s) from lowercase to uppercase
# It will then write the mods to the original file and make a backup of the old one
# If you don't want a backup, assign a null string to $^I

if (@ARGV) {
        $^I=".bk";
        while (<>) {
                print uc;
        } 
} else {
        print "Please enter file you wish to modify in the command line\n";
        print "e.g. program.pl <file1.txt> <file2.txt> <file3.txt>\n";
}


Hopefully it may be of some use to somebody else starting out and stumbling in this 
area.



> 
> From: Ged <[EMAIL PROTECTED]>
> Date: 2003/07/24 Thu AM 08:47:23 GMT
> To: [EMAIL PROTECTED]
> Subject: Re: Re: modifing and writing to a file
> 
> ahhh, thanks. Yes, that makes sense now.
> 
> after reading up on the 'uc' function, I have now got my program to work as required.
> 
> Thanks to all for their input.
> 
> Ged.
> 
> > 
> > From: Sudarshan Raghavan <[EMAIL PROTECTED]>
> > Date: 2003/07/24 Thu AM 08:43:55 GMT
> > To: [EMAIL PROTECTED]
> > Subject: Re: modifing and writing to a file
> > 
> > NYIMI Jose (BMB) wrote:
> > 
> > >s/a-z/A-Z/g should be s/[a-z]/[A-Z]/g;
> > >
> > 
> > Character classes are only possible in the matching part of the regex, 
> > not in the replacement part. You regex says substitute all occurences of 
> > a lowercase alphabet with the string '[A-Z]'
> > 


-----------------------------------------
Email provided by http://www.ntlhome.com/



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to