>>>>> "Robin" == Robin Smidsrød <[EMAIL PROTECTED]> writes:
Robin> Randal L. Schwartz wrote: >> If I recall, you can return an arrayref, which will always be interpreteed >> correctly as an "array" in TT-side. So, returning [] will correctly >> be seen as "size of 0" and [42] will be seen as "size of 1", etc. >> Robin> I have a similar problem. My function has this return statement: Robin> my %hash=( one => 1, two => 2 ); Robin> return wantarray ? %hash : \%hash; Robin> But when I try to access a member in the hash it fails. Right. For this, keep in mind that TT calls this function (if I understand correctly) *always* in a list context, so you'll get the key/value pairs. Ugh. If you always want a "TT Hash", you'll have to always return \%hash even in a list context. -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 <[email protected]> <URL:http://www.stonehenge.com/merlyn/> Perl/Unix/security consulting, Technical writing, Comedy, etc. etc. See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training! _______________________________________________ templates mailing list [email protected] http://lists.template-toolkit.org/mailman/listinfo/templates
