Acme-Stack

 view release on metacpan or  search on metacpan

Stack.pod  view on Meta::CPAN

  There are 3 (unexported) XSubs in this module, namely abc(), def() and ghi().
  They all do the same thing - ie they do nothing other than check that they have
  been passed 4 arguments.
  If they have been passed other than 4 arguments, then they report the
  number of arguments they've received, print out the stringification of the
  first argument, and croak.
  In the test scripts, they're always called explicitly with 4 arguments, so
  it's a bit of a surprise when, under specific conditions, 2 of them will see 5
  5 arguments.

  As best I can tell:
  When perl calls abc(), PL_markstack_ptr is explicitly incremented BEFORE the
  abc() function is actually executed;
  When perl calls def(), PL_markstack_ptr is explicitly incremented just prior
  to the termination of def();
  When perl calls ghi(); PL_markstack_ptr is not explicitly incremented at all.

  Those are the only differences between the 3 functions.
  I conclude that abc() is the one that has been correctly formulated because
  never croaks.
  But I don't really understand how both def() and ghi() manage to see 5 args.



( run in 0.398 second using v1.01-cache-2.11-cpan-4e96b696675 )