in reply to Re: failure to require an installed module + eval fails to trap?
in thread failure to require an installed module + eval fails to trap?
perl -MApache::Session::Postgres -le 'print "@INC"' /opt/m42c/managed/opt/perl/5.8.9/lib/5.8.9/x86_64-linux /opt/m42c/mana +ged/opt/perl/5.8.9/lib/5.8.9 /opt/m42c/managed/opt/perl/5.8.9/lib/sit +e_perl/5.8.9/x86_64-linux /opt/m42c/managed/opt/perl/5.8.9/lib/site_p +erl/5.8.9 .
As I would expect. Also, using <% Dumper(\@INC) %> from inside of a mason component yeilds the same result; (Since Environments can change).
Permissions are not the issue, as the webserver runs as the same user as the module installer, (The whole kit is frameworked into /opt/m42c to isolate everything from any system dependencies. This makes things pretty portable, as long as everything is installed in the same place on a different machine. I'm sure you guys have seen this approach many many times.
Also, I am aware of "require" being far different from "use" and that its use is special.
And switching to "use" actually does not load the module at all, in fact, it wont even pass tests with use, complaining that $sessionClass has not been declared:
But that isn't why I chose to use require. I am simply not importing anything from Apache::Session::Postgres, why would I not require it? Even still the error I get from "using" the Module is concerning at best. (The line containing the import() was not originally there, and I was just testing something quick.).[amps@autotech M42C-Web]$ make test PERL_DL_NONLAZY=1 "/opt/m42c/managed/opt/perl/5.8.9/bin/perl5.8.9" "-M +ExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness:: +Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t t/M42C-Web.t .. Failed 1/1 subtests Test Summary Report ------------------- t/M42C-Web.t (Wstat: 11 Tests: 0 Failed: 0) Non-zero wait status: 11 Parse errors: Bad plan. You planned 1 tests but ran 0. Files=1, Tests=0, 1 wallclock secs ( 0.02 usr 0.01 sys + 0.04 cusr + 0.02 csys = 0.09 CPU) Result: FAIL Failed 1/1 test programs. 0/0 subtests failed. make: *** [test_dynamic] Error 255
You were correct though, chomp($@) placed the blame on the offending line. - I don't eval {} often from within a module, I tend to do that at the GUI level.
Also worth noting that installing the module anyway, despite failing make test, throws a seg fault when it's used.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: failure to require an installed module + eval fails to trap?
by syphilis (Archbishop) on Jul 26, 2015 at 08:25 UTC | |
|
Re^3: failure to require an installed module + eval fails to trap?
by Keep (Initiate) on Jul 26, 2015 at 08:56 UTC |