in reply to Tied hashes and arrays, yeah. But tied typeglobs?
If you want to consider more arbitrary APIs and tie is not doing what you want in terms of overloading behaviour, you can play games with overload instead.my $tho = tie %th, 'My::DB::User', {-data=>\%nu}; while (exists $th{'username'}) { print "username is: $th{'username'}\n"; $tho->nextRow; }
However my suggestion is that your API will quickly become so arbitrary that would-be users will have a hard time figuring out how it could possibly do what it does under the cover, and will get very confused. Were I going from scratch, KISS tells me to seriously consider not setting any tie anywhere because I don't see how it is clarifying my API.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Tied hashes and arrays, yeah. But tied typeglobs?
by Phaysis (Pilgrim) on Oct 04, 2003 at 16:49 UTC |