in reply to references hashes arrays fun ... again :-(

$rec->{'path_details'} = [ @path_details ];
Is this the line you're referring to? If so, I think what you want is..
$rec->{'path_details'} = \@path_details ;
What you have, I *think* is creating an array ref of @path_details evaluated in scalar context, which will be the count of the array. I could be completely wrong, because I usually have to fumble through context related issues to figure out what's going on. But on first glance, this is what I see.

Hope this helps..
Rich

Replies are listed 'Best First'.
Re: Re: references hashes arrays fun ... again :-(
by davorg (Chancellor) on Aug 09, 2001 at 19:29 UTC

    The difference between

    $rec->{'path_details'} = [ @path_details ];

    and

    $rec->{'path_details'} = \@path_details;

    is that the first one creates a copy of @path_details and returns the reference to this new copy, whilst the second one returns a reference to the original @path_details.

    This has nothing to do with context.

    --
    <http://www.dave.org.uk>

    Perl Training in the UK <http://www.iterative-software.com>