Michael,

On Fri, 2003-07-11 at 11:56, Michael Weber wrote:
>         $line =~ s/reject/$red.reject.$normal/gi ;
>         $line =~ s/ from /$yellow from $normal/gi ;
>         $line =~ s/status/$blue status $normal/gi ;

The following does work however I don't know exactly how valid it is
(which is why I'm also sending this to the list so they can make their
comments on it if they have any :-)

        $line =~ s/reject/${red}reject${normal}/gi ;
        $line =~ s/from/${yellow}from${normal}/gi ;
        $line =~ s/status/${blue}status${normal}/gi ;

Now, the reason I'm saying it might not be 'valid' is that it does work
however it was just a technique I stole from bash scripting, never used
it in a perl context before.  Encasing the variable name in {} lets it
know that the variable name has ended, thus you can place a variable
name right next to another word and things won't get confused.  I tested
it out and like I said, it does work, just not sure if it's the best way
to go about it.

Thanks,
Tim.


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

Reply via email to