On 7/12/07, Joseph L. Casale <[EMAIL PROTECTED]> wrote:
Hi All,

How can I make this expression:
$line =~ s/(\S+)\s+(\S+)\s+(\S+)/X$1 Y$2 Z$3/

Add some numerical value to the Z$3 part, so if $3 was 3.14, I want it to be 
Z4.14 for example by adding 1 to it.

Use the e option to turn the replacement into an expression instead of
a double quoted string.

$line =~ s/(\S+)\s+(\S+)\s+(\S+)/"X$1 Y$2 Z" . ($3 + 1)/e

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


Reply via email to