in reply to remove multiple indexes from an array

Does
my %fullhash = (@fulllist);
really work? I'd rather use:
my %fullhash = (); @fullhash(@fulllist) = (); my @fulllist = keys %fullhash; # maybe sort keys
if the listorder doesn't matter

Best regards,
perl -e "print a|r,p|d=>b|p=>chr 3**2 .7=>t and t"

Replies are listed 'Best First'.
Re: Re: remove multiple indexes from an array
by dragonchild (Archbishop) on Dec 18, 2001 at 20:22 UTC
    Hashes can be constructed from lists. In fact, that's what the following is doing:
    my %hash = ( a => 1, b => 2, );
    => is just a comma that quotes the word just to its left, if it's unquoted. :-)

    ------
    We are the carpenters and bricklayers of the Information Age.

    Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.

      Gotcha!

      Run the following from a file. Run it from an eval.

      use strict; my @strange = (explain => "this"); print @strange;
      Yes, this is a bug. Fixed in bleadperl. :-)