I usually find that when I start getting data structures so complicated that I 
have to think about it, it is time to move to objects. Using objects usually 
makes the complicated data structures go away.

Ken Cornetet 812.482.8499
To err is human - to moo, bovine.

-----Original Message-----
From: perl-win32-users-boun...@listserv.activestate.com 
[mailto:perl-win32-users-boun...@listserv.activestate.com] On Behalf Of Gabor 
Szabo
Sent: Tuesday, November 08, 2011 1:06 PM
To: Paul Rousseau
Cc: perl Win32-users
Subject: Re: How to push a hash on to a hash of array entries

On Tue, Nov 8, 2011 at 7:47 PM, Paul Rousseau <paulrousseau...@hotmail.com> 
wrote:
> I am getting closer, Gabor.

I am glad to hear that :)

>
> I had the wrong index. These two lines
>
> push @{$project{$projectno}}, \%days;
> print Dumper %{$project{$projectno}[3]};

I think it is better to always give a reference as a parameter to Dumper (put 
the back-slash in front of the %)

> Now to get at the description within the %days hash. This next line 
> prints a count of the array pointed at by the '3' key.
>
> print "test 1 " . @{${$project{$projectno}[3]}{"3"}};
>
> prints "test 1 2"
>

It looks too complex to me. I wonder if you could change the strategy and work 
with smaller structure. That will be easier to comprehend.
Leaving spaces inside the brackets can also help.
It also seems you have an extra, unnecessary pair of curly braces:

This might be slightly more readable:

@{ $project{ $projectno }[3]{3} }

regards
   Gabor
   Perl Tutorial
   http://szabgab.com/perl_tutorial.html
_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to