perumal has asked for the wisdom of the Perl Monks concerning the following question:

This node falls below the community's minimum standard of quality and will not be displayed.

Replies are listed 'Best First'.
Re: anonymous hash
by Joost (Canon) on Jun 12, 2006 at 07:40 UTC
Re: anonymous hash
by jaa (Friar) on Jun 12, 2006 at 07:40 UTC
    Its a hash without a name of its own - e.g.
    my @list; # push an anonymous hash into @list push @list, { apples => 'green', peaches => 'cream' };
    The hash is created using a pair of curlies, and then pushed straight into our list. The hash never has a name of its own, so you can only refer to it as a member of the list, e.g.
    $list[0]->{pears} = 'expensive';

    Regards,

    Jeff

Re: anonymous hash
by sh1tn (Priest) on Jun 12, 2006 at 07:47 UTC
    In addition - use perldoc -q hash 'How can I make the Perl equivalent of a C structure/C++ class/hash or array of hashes or arrays?' or perlreftut
Re: anonymous hash
by planetscape (Chancellor) on Jun 12, 2006 at 20:24 UTC

    IMHO, one of the best discussions of complex data structures, including anonymous arrays/hashes, is to be found in Chapter 3. References and complex data structures of perlinter.pdf, available from Perl Training Australia. You'd probably want the most current version of the course notes, though, which have been reworked into progperl.pdf, available from the same page noted above.

    You might also wish to take a look at Introduction to anonymous arrays and hashes.

    HTH,

    planetscape
A reply falls below the community's threshold of quality. You may see it by logging in.