in reply to Regular Expn Problem

There's no reason to do this with one expression.
my ($tot, $gcount, $ccount, $ocount); while (<>) { $tot=$1 if /^Total count\s+(\d+)/; $gcount = $1 if /^G\s+(\d+)/; $ccount = $1 if /^C\s+(\d+)/; $ocount = $1 if /^Other\s(\d+)/; }
You could do a series of if..elsif..elsifs, if you preferred.

The PerlMonk tr/// Advocate

Replies are listed 'Best First'.
Re: Re: Regular Expn Problem
by venkatr_n (Sexton) on May 10, 2004 at 06:01 UTC
    I realize I can get around the issue, but I wanted to know why this didnt work.