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
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
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
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]