in reply to Regular Expression to Extract Anything from Colon Delimited String

A snippet/approach for your bag of tricks (and in this case help you sort out if your data structures drift; if so, this approach won’t be enough)–

use strictures; use Data::Dump "dump"; my @col = qw( count grade position name date country age vacant ); my @records; for ( <DATA> ) { my %tmp; @tmp{@col} = split ":"; push @records, \%tmp; } dump \@records;
  • Comment on Re: Regular Expression to Extract Anything from Colon Delimited String
  • Download Code