Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • How about writing a patch to make it more subclassable and sending it to the TT mailing list? Andy seems to be in an active-development, patch-accepting phase at the moment.
    • Good idea.

      Here is the necessary patch.


      --- /usr/lib/perl5/site_perl/5.8.6/i386-linux-thread-multi/Template/Stash/Context.pm 2007-04-27 10:56:05.000000000 -0700
      +++ Context.pm 2008-01-23 18:40:56.000000000 -0800
      @@ -134,6 +134,7 @@
                      %$params,
                      %$ROOT_OPS,
                      '_PARENT' => undef,
      + '_CLASS' => $class,
                };

                bless $self, $class;
      @@ -422,7 +423,7 @@
                        $rootref = 'ARRAY';
                        $root = [$root];
                }
      - if ($rootref eq __PACKAGE__ || $rootref eq 'HASH') {
      + if ($rootref eq $self->{_CLASS} || $rootref eq 'HASH') {

                      # if $root is a regular HASH or a Template::Stash kinda HASH (the
                      # *real* root of everything). We first lookup the named key
      @@ -607,7 +608,7 @@
                return undef ## RETURN
                      unless $root and defined $item and $item !~ /^[\._]/;

      - if ($rootref eq 'HASH' || $rootref eq __PACKAGE__) {
      + if ($rootref eq 'HASH' || $rootref eq $self->{_CLASS}) {
        # if ($item eq 'IMPORT' && UNIVERSAL::isa($value, 'HASH')) {
        # # import hash entries into root hash
        # @$root{ keys %$value } = values %$value;

      I'll send it to Andy Wardley now.