Robert am Donnerstag, 9. Juni 2005 14.51:
> I have a log file where the last portion of the events look like:
>
>     Printer driver: (Lexmark T520)
>
> Where the portion in parens will change but it will always look like that.

If I guess right that you want to extract the portion in (), what about

        perldoc perlrequick
        perldoc perlretut
        perldoc perlre

and 

        my $line = 'Text at beginning of line Printer driver: (Lexmark T520)';
        my ($printer)=$line=~/\((.*)\)\s*$/o;
        print 'Portion in (): ', $printer;



greetings
joe

-- 
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