perl-embperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Angus Lees <...@inodes.org>
Subject Re: DBIx::Recordset struggles to pass tests
Date Sun, 25 Jan 2004 03:02:20 GMT
At Sat, 24 Jan 2004 01:35:02 -0500, Kee Hinckley wrote:
> Okay, I know what the problem is, but I don't know what to do about it.
> tied hashes may not return typeglobs.

I've just spent the last few days hacking around this.  The solution I
came up with (I'll post the patch on tuesday or so) was to make links
always return an array ref (tied to DBIx::Recordset), rather than the
full glob.

Works in most usage cases - if you want the object, you can easily get
it with tied(@$arrayref).  It does mean that you have to do
$set->{-key1}[0]{key2} (ie: insert "[0]" between consecutive hash
lookups), which you didn't /have/ to do before.


An alternative may be to patch perl's sv_upgrade to get back the old
globref handling behaviour.  Given that a tied hash returning a glob
was always breaking the rules, I'm not sure if such a patch would be
accepted anyway..

-- 
 - Gus


---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Mime
View raw message