in reply to Assigning an array of strings to a hash value in an array of hashes

This is because it is in scalar context. See this example:
use Data::Dumper; $string = 'A,B,C'; @test = (); $test[0]{test} = split(/,/, $string); print Dumper(\@test); @test = (); @{$test[0]{test}} = split(/,/, $string); print Dumper(\@test); __END__ $VAR1 = [ { 'test' => 3 } ]; $VAR1 = [ { 'test' => [ 'A', 'B', 'C' ] } ];


--
"I don't intend for this to take on a political tone. I'm just here for the drugs." --Nancy Reagan
  • Comment on Re: Assigning an array of strings to a hash value in an array of hashes
  • Download Code