in reply to Re: @h{qw(a b c)} doesn't create an @h array. It sets 3 scalar values in the %h hash.
in thread @h{qw(a b c)} doesn't create an @h array. It sets 3 scalar values in the %h hash.

...which is related to array slices:

my %hash = ( 'a' => 'A', 'b' => 'B', 'c' => 'C', ); my @array = qw( d e f ); print(join(', ', @hash{'a', 'b'} ), "\n"); # A, B print(join(', ', @array[0, 1] ), "\n"); # d, e
  • Comment on Re^2: @h{qw(a b c)} doesn't create an @h array. It sets 3 scalar values in the %h hash.
  • Download Code