in reply to Array reference of hash references
prints...use warnings; #use strict; use Data::Dumper; while (<DATA>) { @off = split( /' '/, $_ ); %find = ( "start" => $off[0], "stop" => $off[1] ); my $hash_ref = \%find; my @official = []; push @official, $hash_ref; print Dumper(\@official); } __DATA__ 1234 2345 1234 2345 3345 4456
$VAR1 = [ [], { 'stop' => undef, 'start' => '1234 2345 ' } ]; $VAR1 = [ [], { 'stop' => undef, 'start' => '1234 2345 ' } ]; $VAR1 = [ [], { 'stop' => undef, 'start' => '3345 4456 ' } ];
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Array reference of hash references
by PrincePerl (Novice) on Oct 25, 2011 at 22:58 UTC | |
by toolic (Bishop) on Oct 25, 2011 at 23:06 UTC | |
by PrincePerl (Novice) on Oct 25, 2011 at 23:10 UTC | |
by choroba (Cardinal) on Oct 26, 2011 at 07:30 UTC |