Deane,
Thanks very much for your suggestion. It works and it is very similar to what 
Bill gave. Thanks all for the effort.
Zilore




--- On Fri, 5/8/09, [email protected] 
<[email protected]> wrote:

> From: [email protected] <[email protected]>
> Subject: Re: search and replace
> To: [email protected]
> Date: Friday, May 8, 2009, 3:58 PM
> >for my $i (@slashes) {
> >   $slashes =~ s/\/{1,5}/9{1,5}/g;
> >   }
> 
> Your problem is this: You're pacing through the array
> and slapping each 
> member into the variable $i, then doing the substitution on
> the 
> (uninitialized) $slashes.  Suggestion: remove the "my
> $i" from the for 
> loop, viz.:
> 
> for (@slashes) {
>    $_ =~ s/\/{1,5}/9{1,5}/g;
> }
> 
> One thing I'm not certain about is whether the {1,5} is
> even necessary--or 
> if it will DWIM, since you're doing a global
> substitution. Better might be 
> just:
> 
> for (@slashes) {
>    $_ =~ s/\//9/g;
> }
> 
> HTH.
> 
> Deane Rothenmaier
> Programmer/Analyst
> Walgreens Corp.
> 224-542-5150
> 
> I look forward to the invention of faster-than-light
> travel. What I do not 
> look forward to is the long wait in the dark once I arrive
> at my 
> destination. - Marc Beland


      
_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to