in reply to Re: Difference Quantity of two Arrays
in thread Difference Quantity of two Arrays

Thank you for your explanation.

My Perl book says, that delete deletes a key value pair. But it doesn't tell me why I have to use @dbs{@_} instead of $dbs{@_} (which apparently does nothing) or %dbs{@_} (which throws a failure) to get the thing working. Can you explain? :)

  • Comment on Re^2: Difference Quantity of two Arrays

Replies are listed 'Best First'.
Re^3: Difference Quantity of two Arrays
by ikegami (Patriarch) on Jan 02, 2007 at 15:49 UTC

    $ means you're working with one element.
    @ means you're working with multiple elements.

    @hash{@list}
    is a hash slice. It amounts to
    map { $hash{$_} } @list
    but can be used as an lvalue.

    $hash{@list}
    is the same as
    $hash{join($;, @list}}
    It's a means of doing Hash of Hashes without actually using Hash of Hashes. It's generally unused.