in reply to Re: autoloading tie routines
in thread autoloading tie routines
as you had, and a couple of print statements in my AUTOLOAD:use Errno qw(EINVAL); use Tie::Scalar;
No sign of output from the print statements. Here is the output, both under test harness and standalone: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; }
To complete the picture, here's line 42 of the .t file:$ 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. $
Can you (anyone) think of some other requirement I've overlooked, or where else things might have gone wrong?ok (tie(my $tiedScalar, 'IPC::MMA::Scalar', $scalar), "tie scalar");
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: autoloading tie routines
by cmac (Monk) on Feb 02, 2009 at 09:46 UTC | |
by ysth (Canon) on Feb 03, 2009 at 01:21 UTC | |
|
Re^3: autoloading tie routines
by ysth (Canon) on Feb 03, 2009 at 01:24 UTC |