Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: How to better represent a complex data structure.

by muba (Priest)
on Jan 08, 2013 at 16:26 UTC ( #1012277=note: print w/ replies, xml ) Need Help??


in reply to How to better represent a complex data structure.

my %main_file=( USER <= \@user_file, TEST <= \@test_file, TRIM <= \@trim_file, );

Obviously you mean => there ;)

Like this?
push(@{$main_file{"USER"}[0]}, $string);

Have you tried it? Did it fail you?

> perl -Mstrict -MData::Dumper -wE ' my %main_file = ( USER => [ [], [], [] ] ); push @{$main_file{"USER"}[0]}, "string ;)"; print Dumper \%main_file; ' $VAR1 = { 'USER' => [ [ 'string ;)' ], [], [] ] }; >


Comment on Re: How to better represent a complex data structure.
Select or Download Code
Re^2: How to better represent a complex data structure.
by Amblikai (Beadle) on Jan 08, 2013 at 17:17 UTC

    I have tried it roughly, but the mess of code i wrote quickly grew out of hand so i wrote the above to try to simplify it in my head and to simplify the question!

    Thanks for you reply.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2015-07-04 09:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (59 votes), past polls