in reply to Assigning an array of strings to a hash value in an array of hashes
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' ] } ];
|
|---|