The Dump:my %member_info = ( mid=>undef, created_info=>{created_by=>undef, created_date=>undef,}, modified_info=>{modified_by=>undef, modified_date=>undef,}, person=>[ 0=>{salutation=>undef, first_name=>undef, middle_initial=> +undef, last_name=>undef, date_of_birth=>undef, primary_language=>unde +f, secondary_language=>undef, marital_status=>undef, working=>undef, + family_size=>undef, home_days=>undef, leader=>undef, default=>undef, +}, ], school=>[ 0=>{school_type=>"school", school_name=>undef, gradua +tion_date=>undef}, 1=>{school_type=>"school1", school_name=>undef, gradu +ation_date=>undef}, ], ); # declaring it just so I don't forget $response = $browser->get("https://infoishere.org/tails.asp?" . $_ +) if m/^\d+$/; $toke_parse = HTML::TokeParser->new( \$response->content ); #tokeparse full document, fill structure with data while($token = $toke_parse->get_token){ #match the table id's to start per-table loops next unless ($token->[0] eq 'S' and $token->[1] eq 'table'); # +only test table start tokes, skip other tokes if(($token->[0] eq "S") and ($token->[4] =~ m/id.{1,3}table13/ +i)){ #member unique id and name $token = $toke_parse->get_token until(($token->[0] eq "E") and + ($token->[1] =~ m/tr/i)); # end header row #debugging print Dumper(\%member_info); $member_info{'person'}[0]{'salutation'} = &skip_to_cell_text( +1 ); # error on this line $member_info{'person'}[0]{'first_name'} =&skip_to_cell_text( 1 + ); $member_info{'person'}[0]{'middle_initial'} = &skip_to_cell_te +xt( 1 ); [...]
$VAR1 = { 'modified_info' => { 'modified_date' => undef, 'modified_by' => undef }, 'created_info' => { 'created_date' => undef, 'created_by' => undef }, 'person' => [ 0, { 'middle_initial' => undef, 'salutation' => undef, 'leader' => undef, 'marital_status' => undef, 'date_of_birth' => undef, 'last_name' => undef, 'family_size' => undef, 'primary_language' => undef, 'default' => undef, 'secondary_language' => undef, 'home_days' => undef, 'first_name' => undef } ], 'school' => [ 0, { 'graduation_date' => undef, 'school_name' => undef, 'school_type' => 'school' }, 1, { 'graduation_date' => undef, 'school_name' => undef, 'school_type' => 'school1' } ], 'mid' => undef };
In reply to Mistake in data structure use? by McLogic
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |