Alternatively, you could set the input record separator ($/) to "-------", which simplifies things a bit:
$/ = "-------\n"; my @records; while (<>) { my @entries = map { /([^:]+):\s*(.*)/ } split /\n/; push @records, { @entries } if @entries; }
In reply to Re^2: Data extraction from text file
by Eliya
in thread Data extraction from text file
by usadhikari
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |