I'm glad to hear you're still happy with DBIx::Simple.
About the TT issue: While I understand the problem and acknowledge that it is annoying, I strongly believe that this should not be fixed in the numerous modules that happen to be compatible with Template Toolkit, but in Template Toolkit itself. I might release a compatibility package, but I'm not willing to mess with DBIx::Simple itself for this.
I find the name "hash_array" very confusing, by the way. I'd probably call it "array_of_hashes".
The correct solution to this problem, if you want it in DBIx::Simple, is to use your own result class. Untested code follows.
use strict;
package DBIx::Simple::TT;
use base 'DBIx::Simple';
sub connect {
my $self = shift->SUPER::connect(@_);
$self->result_class = 'DBIx::Simple::Result::ForcedScalar';
}
package DBIx::Simple::Result::ForcedScalar;
use base 'DBIx::Simple::Result';
my $stash = \%DBIx::Simple::Result::ForcedScalar::;
our %list_methods;
$list_methods{$_} = 1 for qw(
arrays hashes list flat columns map map_hashes map_arrays
);
for my $method (keys %list_methods) {
$method =~ /^[a-z]\w+$/ or next;
my $supermethod = "SUPER::$method";
$stash->{$method} = sub { scalar shift->$method(@_) };
}
Do you think that this would solve your problem?
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Outside of code tags, you may need to use entities for some characters:
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
|
|