> -----Original Message-----
> From: Karyn Williams [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, April 17, 2007 15:14
> To: Perl Beginners
> Subject: substitute and assign in one line
> 
> This is probably very simple, but I'm not seeing it. I want to do the
> following:
> 
> 
> my $lfirst = $first;
> $lfirst =~ s/[^a-zA-Z]//g;
> 
> in one line. I tried :
> 
> my $lfirst = ($first =~ s/[^a-zA-Z]//g); 
        close, but try
(my $lfirst = $first) =~ s/[^a-zA-Z]//g;
 Wags ;)

> 
> but it returned either a blank or null.
> 
> I want to maintain the state of $first and store the alpha 
> only version in
> $lfirst.
> 
> TIA.
> 
> 
> 
> -- 
> 
> Karyn Williams
> Network Services Manager
> California Institute of the Arts
> [EMAIL PROTECTED]
> http://www.calarts.edu/network
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> http://learn.perl.org/
> 
> 
> 

**********************************************************************
This message contains information that is confidential and proprietary to FedEx 
Freight or its affiliates.  It is intended only for the recipient named and for 
the express  purpose(s) described therein.  Any other use is prohibited.
**********************************************************************


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


  • RE: substitute and ass... Wagner, David --- Senior Programmer Analyst --- WGO

Reply via email to