in reply to regex question

How is the file set up? Do the lines alternate? Is what you generically need is anything before the first pipe (|) and anything before the first comma? If so...
while (<FILE>) { if ( $. % 2 ) { $gref = (split /\|/, $_)[0]; } else { $type = (split /,/, $_)[0]; } }

Replies are listed 'Best First'.
Re^2: regex question
by Anonymous Monk on Jun 01, 2005 at 15:41 UTC
    thanks, seems fine now