Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^13: Merge hashes in specific format

by tybalt89 (Prior)
on Jan 13, 2019 at 00:41 UTC ( #1228447=note: print w/replies, xml ) Need Help??


in reply to Re^12: Merge hashes in specific format
in thread Merge hashes in specific format

That's not a sub.

Posting incomplete code will cause an incomplete an

Replies are listed 'Best First'.
Re^14: Merge hashes in specific format
by ovedpo15 (Pilgrim) on Jan 13, 2019 at 00:46 UTC
    I'm sorry. here you go:
    my %final_href; merge_jsons(".data.json",\@dirs,\%final_href); sub merge_jsons { my ($name,$dirs,$final_href) = @_; my %data; foreach my $dir (@{$dirs}) { decode($dir."/".$name,%data); # will change name my $final_href = ( data => { ( %{$final_href->{data} },%{ $data{data} } ) }, total => do { my %total; for my $href ( $final_href->{total}, $data{total} ) { $total{$_} += $href->{total}{$_} for keys %{ $href->{to +tal} }; } \%total; } ); } }
Re^14: Merge hashes in specific format
by LanX (Sage) on Jan 13, 2019 at 00:48 UTC
    > Posting incomplete code will cause an incomplete an

    brilliant! xD

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery FootballPerl is like chess, only without the dice

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1228447]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (6)
As of 2022-01-26 16:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (69 votes). Check out past polls.

    Notices?