in reply to Database?
This will leave the data in %db, indexed by Name, and each element will be a hash reference with two elements called Othername and postmaster.open FILE, "<file" or die "$!\n"; { local $/=""; while ($rec=<FILE>) { my @fields=split("\n", $rec); my $key; foreach (@fields) { my ($index, $value)=split(/\s*:\s*/, $_, 2); if ($index eq 'Name') { $key=$index; $db{$key}={}; } else { $db{$key}->{$index}=$value; } } } close FILE; }
--ZZamboni
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
This is what I use currenly :)
by Anonymous Monk on May 10, 2000 at 02:22 UTC |