Hi,

I think that you are looking for a "zero-width positive lookahead assertion" 
i.e. (?=...)

So a solution for problem might be:
my $line  = ",.,.,.";
$line =~ s/,\.(?=,|$)/,/g;

TTFN
Yaron Kahanovitch




----- Original Message -----
From: "Kevin Viel" <[EMAIL PROTECTED]>
To: beginners@perl.org
Sent: 21:19:00 (GMT+0200) Africa/Harare יום שני 15 אוקטובר 2007
Subject: Overlapping substitution

I have to change the a CSV file, which represents numeric missing data with
a period (.).  For instance:

One,.,.,.

Should be:

One,,,

I have written:


$_ =~ s/,\.,/,,/g ;


However, I have a requirement to substitute overlapping data.  Do I need to
write a loop conditional on a match of /,\.,/ or is there something I
missed?

Thank you,

Kevin

                

Kevin Viel, PhD
Post-doctoral fellow
Department of Genetics
Southwest Foundation for Biomedical Research
San Antonio, TX 78227  


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




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


Reply via email to