> if (/([0-9.]{6}) set/) {
> s/$1 set/\n-50.2 v \n$1 set/;
You need to escape the period or it will match any character but
newline. As it is right now you'll match ".FANTA", which isn't what
you want.
> Why does this syntax not work? The $1 does not come out.
You can't use variables in the regex portion of your substitution. If
all you're going to do is a substitution you don't need the if
statement. However, either way, this is probably the substitution
you're looking for:
s/([0-9\.]{6}) set/\n-50.2 v \n$1 set/;
Have a good one.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>