http://www.perlmonks.org?node_id=536779


in reply to Simple RegEx Substring Extraction from a Delimited Text Record

($int) = $rec =~ /(INT=\d*(?=!|$))/

Or you can internalize your DB into structured data when you load it, rather than pass around such strings. Or you can consider Data::Record.

I tend to make a blessed array for the database, and fill it with objects for the records. At least at first.