CC: | tobyc [...] strategicdata.com.au |
Subject: | ensure_class_loaded() fails when class is inside a 'use PAR' archive. |
The ensure_class_found() method should return true if the given class
name is installed on the system.
If you run a script.pl + module.pm when they are BOTH inside a PAR file,
or BOTH in a normal filesystem, then the ensure_class_found() method
will successfully indicate that module is installed.
However is module.pm is inside a PAR file, and script.pl is doing "use
PAR 'module.par';" in order to access it, then the ensure_class_found()
method will incorrectly report that module is NOT installed.
Attached are two files, foobar.par (containing test_c3.pl and
Foo/Bar.pm) and test_c3_par.pl.
To demonstrate the problem, first try running:
parl foobar.par test_c3.pl
-- This returns that Foo::Bar was located.
Then run:
./test_c3_par.pl
-- this returns that Foo::Bar was NOT located.
Subject: | test_c3_par.pl |
#!/usr/bin/perl
use strict;
use warnings;
use PAR 'foobar.par';
use base 'Class::C3::Componentised';
__PACKAGE__->ensure_class_found('Foo::Bar') or die("Foo::Bar not found");
print "Foo::Bar found.\n";
Subject: | foobar.par |
Message body not shown because it is not plain text.