in reply to RE: You can't get there from here....
in thread References of Eternal Peril
Plan B: If you want the advantages of variables and the advantages of hashes, there is a way, but it will cost you a little in speed. There is one language construct that can see variables and can be built with strings, even with strict enabled: eval.{ no strict 'refs'; $sth->bind_columns( map { \${"c_$_"} @{ $sth->{NAMES_lc} } ) }
However, now you're actually letting column names into the Perl parser! A saying about frying pans and fires comes to mind.... I'd much rather disable strict than make wide use of eval STRING.local $, = ',$'; # saves on the joins eval "\$sth->bind_columns(\\( \$@{$sth->{NAMES_lc}} ))"
As for pseudohashes: I think they're great. The only thing about their implementation in Perl 5 that ate me alive was the fact that they weren't a distinct data type, but rather a mere access method, usable with any array at any time. If they had to be declared somehow at their creation, hey, I'd have been praising them in my Topaz talk.
-- Chip Salzenberg, Free-Floating Agent of Chaos
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(Package Data) RE: (3) You can't get there from here....
by mwp (Hermit) on Aug 11, 2000 at 21:22 UTC | |
by chromatic (Archbishop) on Aug 12, 2000 at 00:08 UTC | |
by mwp (Hermit) on Aug 12, 2000 at 00:28 UTC | |
by chromatic (Archbishop) on Aug 12, 2000 at 00:41 UTC | |
|
RE (3): You can't get there from here....
by tilly (Archbishop) on Aug 11, 2000 at 15:45 UTC |