in reply to Hashrefs and arrayrefs

As usual TMTOWTDI.
Both of your suggestions worked.
I am using strict as well as warnings (part of the code I did not post). The issue was I put the  my %info outside the foreach loop, so it was not localized correctly. Once I moved the %info declaration inside the foreach, presto, it worked. And I understand it.

To avoid cargo cult programming, I must ask kappa about the syntax of  push(@tmplt_list, {%info});. What does the extra set of braces around %info accomplish?

Thank you, again

Replies are listed 'Best First'.
Re: Re: Hashrefs and arrayrefs
by Juerd (Abbot) on Apr 19, 2002 at 15:16 UTC

    push(@tmplt_list, {%info}); . What does the extra set of braces around %info accomplish?

    They create a reference to an anonymous hash, that in this case consists of the same elements as the %info hash. In other words: it copies %info to a hash without a name, and returns a reference to it.

    Would you want to reference the original %info (which is more efficient but not always what you want), you would use:

    push @tmplt_list, \%info;

    - Yes, I reinvent wheels.
    - Spam: Visit eurotraQ.