in reply to Regex problem

Hello,

here is how I would do it :
$filename = 'cow.pl'; undef $/; my ($file, $lineCount) = (<DATA> =~ m/^(\Q$filename\E) ~ (\d+)$/m); __DATA__ hi.pl ~ 6454 low.pl ~ 757 cow.pl ~ 43 low.pl ~ 757

HTH

--
zejames

Replies are listed 'Best First'.
Re: Re: Regex problem
by DS (Acolyte) on Jul 16, 2002 at 13:26 UTC
    thanks ;;)