Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

poj's scratchpad

by poj (Vicar)
on Jun 12, 2013 at 17:16 UTC ( #1038520=scratchpad: print w/ replies, xml ) Need Help??

#!perl use strict; use Data::Dump 'pp'; my @princ; push @princ, ( {ACCOUNT=>'accountOne',NAME=>'name1',QDT=>'qdt1'}, {ACCOUNT=>'account2',NAME=>'name2',QDT=>'qdt2'}, {ACCOUNT=>'account3',NAME=>'name3',QDT=>'qdt3'}, ); my @type = (); push @type, ( {HOME_NUMBER=>'house for first account',YEAR=>'year for forst accoun +t',MONTH=>'the month for the first account', ACCOUNT=>'accountOne',}, {HOME_NUMBER=>'house sec account',YEAR=>'year for the second',MONT +H=>'month for the second', ACCOUNT=>'account2',}, {HOME_NUMBER=>'house for the 3rd account', YEAR=>'year for 3',MONT +H=>'month for the third', ACCOUNT=>'account3',}, ); my @person = (); push @person, ( {PERSON_ID=>'this is the id for the first account',PERSON=>'and the + person for the first account',DATE=>'also the date for the first acc +ount', ACCOUNT=>'accountOne',}, {PERSON_ID=>'id for the sec2',PERSON=>'This is the person2',DATE=> +'The date forthe sec', ACCOUNT=>'account2',}, {PERSON_ID=>'The id3',PERSON=>'person data for the third acc',DATE +=>'The date matches the Third account', ACCOUNT=>'account3',}, ); my %hash=(); for my $t (@type){ my $acc = $t->{'ACCOUNT'}; push @{$hash{$acc}{'TYPE'}},$t; } for my $p (@person){ my $acc = $p->{'ACCOUNT'}; push @{$hash{$acc}{'PERSON'}},$p; } my @data=(); for my $p (@princ){ my $acc = $p->{'ACCOUNT'}; push @data, { PRINC =>1,PRINC_DATA => [$p], TYPE =>1,TYPE_DATA => $hash{$acc}{'TYPE'}, PERSON=>1,PERSON_DATA=> $hash{$acc}{'PERSON'}, }; } pp \@data;
Log In?

What's my password?
Create A New User
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2015-11-28 12:59 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (741 votes), past polls