* DC <[EMAIL PROTECTED]> [2002-06-14 16:08]:
> I'm having a strange problem and I'm looking for help.  Last year I
> wrote a CMS with a lot of help from TT2.  I'm now migrating said CMS
> to a new machine and things aren't just magically working liked I'd
> hoped they would.

Isn't that always the way? ;)

> Is there something in general I should know about that may have
> changed regarding the defining of custom virtual methods?  On the
> original server, I'm running TT2v2.06 and on the new machine I'm
> running v2.07).  I am happy to explain in more depth how things work
> in my CMS, but I thought I'd just post the general symptom first and
> see if there were any "aha!"s out there before I dive into the gory
> details.

I've had issues like this in the past, and they almost always involved
incorrectly assigning to the _OPS hashref.  I usually redefine
$Template::Stash::*_OPS like so:

  my %list_ops = ( );   # define ops here
  $Template::Stash::LIST_OPS = {
      %{ $Template::Stash::LIST_OPS },
      %list_ops,
  };

You can add something like this to your module, and call it from somewhere:

  use Data::Dumper;
  sub debugger {
      print Dumper($Template::Stash::LIST_OPS);
  }

You should see something to the effect of:

$VAR1 = {
          'join' => sub { "DUMMY" },
          'first' => sub { "DUMMY" },
          'item' => sub { "DUMMY" },
          'nsort' => sub { "DUMMY" },
          'pop' => sub { "DUMMY" },
          'shift' => sub { "DUMMY" },
          'max' => sub { "DUMMY" },
          'size' => sub { "DUMMY" },
          'scalar' => sub { "DUMMY" },
          'list' => sub { "DUMMY" },
          'reverse' => sub { "DUMMY" },
          'rand' => sub { "DUMMY" },
          'grep' => sub { "DUMMY" },
          'unshift' => sub { "DUMMY" },
          'last' => sub { "DUMMY" },
          'push' => sub { "DUMMY" },
          'hash' => sub { "DUMMY" },
          'sort' => sub { "DUMMY" }
        };

Look for your vmeth in the keys.

By the way, I'd be interested in seeing what vmeths you've defined; I'm
a huge fan of vmeths and use them all over the place, and I'm always
looking for new ideas for them.

(darren)

-- 
Be who you are and say what you feel, because those who mind don't
matter and those who matter don't mind.
    -- Dr. Seuss


Reply via email to