in reply to delimited strings into a hash of hashes
This should do the trick:
my $r; ... while( <> ) { chomp; $r = insert($r, split /[-_.]/, $_); } sub insert { my $r = shift; my $last = \$r; $last = \$$last->{$_} for @_; $$last ||= 1; $r; }
edit: fixed up call to insert()
- another intruder with the mooring in the heart of the Perl
|
|---|