I put in a
use Errno qw(EINVAL); use Tie::Scalar;
as you had, and a couple of print statements in my AUTOLOAD:
sub AUTOLOAD { my $constname; ($constname = $AUTOLOAD) =~ s/.*:://; croak "& not defined" if $constname eq 'constant'; my $val = constant($constname, @_ ? $_[0] : 0); if ($! != 0) { if ($! =~ /Invalid/ || $!{EINVAL}) { print "just before AUTOLOAD\n"; $AutoLoader::AUTOLOAD = $AUTOLOAD; goto &AutoLoader::AUTOLOAD; } else { croak "Your vendor has not defined MMA macro $constname"; } } print "just before eval\n"; eval "sub $AUTOLOAD { $val }"; goto &$AUTOLOAD; }
No sign of output from the print statements. Here is the output, both under test harness and standalone:
$ make test PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_h +arness(0, 'blib/lib', 'blib/arch')" t/*.t t/6_tiedScalars....1/18 Undefined subroutine &IPC::MMA::Scalar::TIESCA +LAR called at t/6_tiedScalars.t line 42. # Looks like you planned 18 tests but ran 4. # Looks like your test exited with 255 just after 4. t/6_tiedScalars.... Dubious, test returned 255 (wstat 65280, 0xff00) Failed 14/18 subtests Test Summary Report ------------------- t/6_tiedScalars (Wstat: 65280 Tests: 4 Failed: 0) Non-zero exit status: 255 Parse errors: Bad plan. You planned 18 tests but ran 4. Files=1, Tests=4, 0 wallclock secs ( 0.03 usr 0.00 sys + 0.05 cusr + 0.00 csys = 0.09 CPU) Result: FAIL Failed 1/1 test programs. 0/4 subtests failed. *** Error code 255 Stop in /build/IPC-MMA-0.5. $ t/6_tiedScalars.t 1..18 ok 1 - created shared mem ok 2 - read available mem ok 3 - make scalar ok 4 - effect on available mem is -16 Undefined subroutine &IPC::MMA::Scalar::TIESCALAR called at t/6_tiedSc +alars.t line 42. # Looks like you planned 18 tests but ran 4. # Looks like your test exited with 255 just after 4. $
To complete the picture, here's line 42 of the .t file:
ok (tie(my $tiedScalar, 'IPC::MMA::Scalar', $scalar), "tie scalar");
Can you (anyone) think of some other requirement I've overlooked, or where else things might have gone wrong?

In reply to Re^2: autoloading tie routines by cmac
in thread autoloading tie routines by cmac

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • 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, details, 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, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.