Prasad K M wrote:
> 
> From: "John W. Krahn" <[EMAIL PROTECTED]>
> 
> > Prasad K M wrote:
> > >
> > > I want to read a file and print all the text , but reverse the case.
> > > So all small will become CAPS and CAPS will be small .
> > > The problem is toggling the case. Any idea as how to accomplish it ?
> >
> > $ perl -le'$_ = "This Is A Mixed Case Sentence."; tr/a-zA-Z/A-Za-z/;
> > print'
> > tHIS iS a mIXED cASE sENTENCE.
> 
> thanks...
> i am trying to search a pattern and replace that pattern with its toggled
> version...
> 
> eg: s/pattern/<toggled>/g
> 
> the prob is i can't embed 'tr/a-zA-Z/A-Za-z/' in the <toggled> part or
> atleast i dont know how to do it !!

$ perl -le'$_ = "This Is A Mixed Case Sentence.";
s/(mixed)/($a=$1)=~tr!a-zA-Z!A-Za-z!;$a/ieg; print'
This Is A mIXED Case Sentence.



John
-- 
use Perl;
program
fulfillment

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

Reply via email to