in reply to Re: Re: Re: Re: Re: Better way to search?
in thread Better way to search?

Sorry to keep bugging y'all, but this is really helpful and interesting. So if I did something like this:
@exts{@exts} = @exts;
would that make both the keys AND the values equal (and obviously, the values of the @exts array)?

Replies are listed 'Best First'.
Re (6): Better way to search?
by btrott (Parson) on Jan 05, 2001 at 06:40 UTC
    Yes. See:
    my @exts = qw/foo bar baz/; my %exts; @exts{@exts} = @exts; use Data::Dumper; print Dumper \%exts;
    produces:
    $VAR1 = { 'foo' => 'foo', 'baz' => 'baz', 'bar' => 'bar' };
    I might point out that nothing answers a question so well as testing a bit of code out yourself. :)