related question:  I want to strip out any '*' symbols as well, and replace
them with a zero.  So, I changed my code to reflect:

$origFee =~ s/[%\*]/0/;

It appears that it strips out the % successfully, but anywhere I have a '*'
symbol just gets overlooked.  Any thoughts?
-----Original Message-----
From: John W. Krahn [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 21, 2001 9:05 PM
To: [EMAIL PROTECTED]
Subject: Re: substitution


Herb Martin wrote:
> 
> > s/%//;  # replaces any '%' signs in $_ with nothing
> >
> > but, I want to replace any '%' signs in
> > $iAmAVariableHearMeRoar with nothing
> 
> (Correct) Answer given by another poster:
> >> $iAmAVariableHearMeRoar =~ s/%//;
> 
> The original message did IMPLY there might be MULTIPLE
> '%' characters (perhaps not together.)
> 
> If THIS is the REAL request, try this:
> 
> $iAmAVariableHearMeRoar =~ s/%//g;
> 
> g = "globally" (or multiple patterns where found.)

Or if you want to do it more efficiently (the string is really long.)

$iAmAVariableHearMeRoar =~ tr/%//d;


John
-- 
use Perl;
program
fulfillment

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

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

Reply via email to