use strict; use warnings; use Data::Dumper; while(){ my( $notesField )= /"(.*)"/; my @parts = split /\s?(First Name|Last Name|Address|City|State|ZIP Code|E-mail): /, $notesField; shift @parts; my %parts = @parts; print Dumper \%parts; } __DATA__ ,,,,,,,,,,,,,,,,,,,,,,,,,"First Name: Dobbin Last Name: David L. Address: david@adamsonanddobbin.com City: PO Box 1326407 Pido Road State: Peterborough ZIP Code: ON Country: K9J 7H5 First Name: Dobbin Last Name: David L. E-mail: david@adamsonanddobbin.com Address: PO Box 1326407 Pido Road City: Peterborough State: ON ZIP Code: K9J 7H5",,,,,,Home,743 7790,Other,742 4524,Work,745 5751,,,,,,,,,,,Adamson And Dobbin Ltd. Mechanical Contractors,,General Manager,,,,,,,,,,, ,,,,,,,,,,,,,,,,,,,,,,,,,"First Name: Chapleau Last Name: Kathy, Ken Address: 666 FrankFirst Name: Chapleau Last Name: Kathy, Ken City: 666 Frank",,,,,,Home,876-9863,,,,,,,,,,,,,,,Admiralty Hall,,Accountant,,,,,,,,,,, #### $VAR1 = { 'First Name' => 'Dobbin', 'ZIP Code' => 'K9J 7H5', 'Address' => 'PO Box 1326407 Pido Road', 'Last Name' => 'David L.', 'City' => 'Peterborough', 'E-mail' => 'david@adamsonanddobbin.com', 'State' => 'ON' }; $VAR1 = { 'First Name' => 'Chapleau', 'Address' => '666 Frank', 'Last Name' => 'Kathy, Ken', 'City' => '666 Frank' };