Re: Problem about substitution..

2009-11-03 Thread tom smith
On Tue, Nov 3, 2009 at 4:33 PM, tom smith wrote: > Thanks for the tips! More comments below. > I saw it written the other way somewhere, and I thought it looked cleaner. > I'll do it your way from now on. > > >> >> if ($line =~ /\((.*?)\)/) { >>> >>>$line =~ s/$1/$i;$j/; >>> >> >> If

Re: Problem about substitution..

2009-11-03 Thread tom smith
Thanks for the tips! More comments below. On Tue, Nov 3, 2009 at 4:10 AM, John W. Krahn wrote: > tom smith wrote: > >> On Mon, Nov 2, 2009 at 7:41 PM, Remy Guo wrote: >> >> i've got problem when trying to perform a substitution. >>> >>> the text file i want to process is like this: >>> ... >>

Re: Problem about substitution..

2009-11-03 Thread John W. Krahn
tom smith wrote: On Tue, Nov 3, 2009 at 4:33 PM, tom smith wrote: Thanks for the tips! More comments below. I saw it written the other way somewhere, and I thought it looked cleaner. I'll do it your way from now on. if ($line =~ /\((.*?)\)/) { $line =~ s/$1/$i;$j/; If you hav

Re: Problem about substitution..

2009-11-03 Thread John W. Krahn
tom smith wrote: On Mon, Nov 2, 2009 at 7:41 PM, Remy Guo wrote: i've got problem when trying to perform a substitution. the text file i want to process is like this: ... XX { ABDADADGA afj*DHFHH } (a123) XXDFAAF { af2hwefh fauufui } (b332) ... i want to match the content in the paren

Re: Problem about substitution..

2009-11-03 Thread tom smith
On Mon, Nov 2, 2009 at 7:41 PM, Remy Guo wrote: > hi folks, > i've got problem when trying to perform a substitution. > > the text file i want to process is like this: > ... > XX { > ABDADADGA > afj*DHFHH > } (a123) > XXDFAAF { > af2hwefh > fauufui > } (b332) > ... > > i want to match the

Re: Problem about substitution..

2009-11-02 Thread John W. Krahn
Remy Guo wrote: hi folks, Hello, i've got problem when trying to perform a substitution. the text file i want to process is like this: ... XX { ABDADADGA afj*DHFHH } (a123) XXDFAAF { af2hwefh fauufui } (b332) ... i want to match the content in the parenthesis (a123 and b332, here) an

Re: Problem about substitution..

2009-11-02 Thread Remy Guo
oops...sorry, the subitution line should be $_ =~ s/\(.*\)/$i;$j/ but it doesn't work... 2009/11/3 Remy Guo > hi folks, > i've got problem when trying to perform a substitution. > > the text file i want to process is like this: > ... > XX { > ABDADADGA > afj*DHFHH > } (a123) > XXDFAAF { >

Problem about substitution..

2009-11-02 Thread Remy Guo
hi folks, i've got problem when trying to perform a substitution. the text file i want to process is like this: ... XX { ABDADADGA afj*DHFHH } (a123) XXDFAAF { af2hwefh fauufui } (b332) ... i want to match the content in the parenthesis (a123 and b332, here) and replace them with a sorted