>FlashMX wrote:
>> Cool...that worked...thanks
>>
>> I forgot to mention that one the match is found I do a search and replace
>>
>> if (/[0-9.]{6} setgray/) {
>> s/.90000 set/-50.2 v \n.90000 set/;
>>
>> This is the issue. I need to "grab" the match number (whatever it is) and
>> add it into the s/
>>
>> So...
>>
>> if (/[0-9.]{6} setgray/) {
>> s/NUMBER_FROM_ABOVE set/-50.2 v \nNUMBER_FROM_ABOVE set/;
>>
>>
>>
>
>perldoc perlretut
>perldoc perlre
>
>You need to capture the value then...
>
>if (/([0-9.]{6}) setgray/) {
> s/$1 set/-50.2 v \n$1 set/;
>}
>
>Which can be shortened more, but I would leave it readable. Capture
>values with ()'s and then use those ordered matches by accessing, $1,
>$2, $3, etc.
>
>http://danconia.org
Hmm...I just tried the above and nothing gets replaced in my output file. Could
it be the syntax?
if (/([0-9.]{6}) set/) {
s/$1 set/-50.2 v \n$1 set/;
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>