Because it's up-side down.
Why is that?
It makes replies harder to read.
Why not?
Please don't top-post.
(Sherm Pendley, MacOSX List)

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

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




Reply via email to