Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

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 meditating upon the Monastery: (5)
As of 2015-12-02 01:41 GMT
Find Nodes?
    Voting Booth?

    My keyboard shows this many letters:

    Results (31 votes), past polls