in reply to Re: Efficient access to sparse lists?
in thread Efficient access to sparse lists?
my %hash = (); for(my $x = 0; $x <= $#sparse_list; $x++) { my $y = $spase_list[$x]; next if $y eq undef; $hash{$x} = $y; }
As an aside, you can use exists and delete on array elements but it comes highly discouraged. So don't do it.
Apologies for the typos...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: (corrections) Re: Answer: Efficient access to sparse lists?
by Improv (Pilgrim) on Jan 26, 2001 at 01:45 UTC | |
by tye (Sage) on Jan 26, 2001 at 02:22 UTC | |
by BoredByPolitics (Scribe) on Jan 26, 2001 at 06:08 UTC | |
by tilly (Archbishop) on Jan 26, 2001 at 06:56 UTC | |
by tye (Sage) on Jan 30, 2001 at 21:11 UTC | |
by tilly (Archbishop) on Jan 30, 2001 at 21:30 UTC | |
by tye (Sage) on Jan 30, 2001 at 21:36 UTC | |
|