Re: replacing parts of a string

2003-06-09 Thread Rob Dixon
Christopher J Bottaro wrote: > hello, > i want to do something like: > $line =~ s/M (\d+) (\d+)/M $1+100 $2+200/; > obviously adding 100 to $1 and 200 to $2, not adding the text '+100' and > '+200'. use strict; my $line = ''; $line =~ s{M (\d+) (\d+)} { sprint

Re: replacing parts of a string

2003-06-09 Thread Tassilo von Parseval
On Mon, Jun 09, 2003 at 04:53:53AM -0500 christopher j bottaro wrote: > i want to do something like: > $line =~ s/M (\d+) (\d+)/M $1+100 $2+200/; > obviously adding 100 to $1 and 200 to $2, not adding the text '+100' and > '+200'. Use the /e modifier and turn the substitution side into a valid P

Re: replacing parts of a string

2003-06-09 Thread Jenda Krynicky
From: christopher j bottaro <[EMAIL PROTECTED]> > hello, > i want to do something like: > $line =~ s/M (\d+) (\d+)/M $1+100 $2+200/; > obviously adding 100 to $1 and 200 to $2, not adding the text '+100' > and '+200'. $line =~ s/M (\d+) (\d+)/'M ' . ($1+100) . ' ' . ($2+200)/e; Read perld

replacing parts of a string

2003-06-09 Thread christopher j bottaro
hello, i want to do something like: $line =~ s/M (\d+) (\d+)/M $1+100 $2+200/; obviously adding 100 to $1 and 200 to $2, not adding the text '+100' and '+200'. thanks for the help, -- christopher -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]