in reply to Larry Gets The Colon. (selective addition of an arrayref to a hash) (code)
# if we haven't hit this line yet, add an array # reference to %statistics at this line number. if (not defined $statistics{$line_number} ) { $statistics{$line_number} = [ $thisline ]; next; # or return or whatever to avoid next push } # now we know that we have an array ref # and all we have to do is push it. push @{ $statistics{$line_number} }, $thisline;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Larry Gets The Colon. (selective addition of an arrayref to a hash) (code)
by Vynce (Friar) on Jun 02, 2001 at 12:43 UTC |