Ok, in the middle of a C function I have this:

  /* $n = $seq->length() */
  Inline_Stack_Reset; Inline_Stack_Push(seq); Inline_Stack_Done;
  call_method("length", G_SCALAR);
  if (SvIOK(Inline_Stack_Item(0))) {
    n = SvIV(Inline_Stack_Item(0));
  }

This works fine.  But then a few lines later:

  /* read.base = $seq->seq() */
  Inline_Stack_Reset; Inline_Stack_Push(seq); Inline_Stack_Done;
  call_method("seq", G_SCALAR);
  if (SvPOK(Inline_Stack_Item(0))) {
    strncpy(read->base, SvPV_nolen(Inline_Stack_Item(0)), n + 1);
  }

And I get:
Can't locate object method "seq" via package "pln" (perhaps you forgot to
load "pln"?) at blib/lib/Bio/SeqIO/staden/read.pm line 132

Now my blessed ref "seq" is not the scalar string "pln", it's a real live
blessed object (sv_isa(seq, "The::Right::Package") is true).  This smells
more like the Inline_Stack_Reset and friends not really repositioning the
stack correctly (translated as: how do I get these to correctly reposition
the stack for multiple call_method()'s).  Or maybe it's something else?
Do I need to use ENTER; LEAVE; stuff?

Thanks for any help, or "gotchyas".

-Aaron

Reply via email to