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 = '<        M 123 654       >';

  $line =~ s{M (\d+) (\d+)} {
    sprintf 'M %d %d', $1+100, $2+200
  }e;

  print $line;

OUTPUT

  <        M 223 854       >

HTH,

Rob




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to