in reply to Pattern with split
Here's an idea: don't. There's clever, and then there's trying to be too clever.
Given that it looks like you've got several different record types which start with a different first field, the more maintainable approach might be to split or regex off the type field (my( $type, $rest ) = split( /\s+/, $record, 2 );) then use a dispatch table to figure out what to do with $rest.
|
|---|