CC: | tobyc [...] strategicdata.com.au |
Subject: | ensure_class_loaded() fails when class is inside a 'use PAR' archive. |
MIME-Version: | 1.0 |
X-Mailer: | MIME-tools 5.427 (Entity 5.427) |
Charset: | utf8 |
X-RT-Original-Encoding: | utf-8 |
Content-Type: | multipart/mixed; boundary="----------=_1233105911-29719-674" |
Content-Length: | 0 |
Content-Disposition: | inline |
Content-Type: | text/plain |
Content-Transfer-Encoding: | binary |
Content-Length: | 790 |
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 |
MIME-Version: | 1.0 |
Content-Type: | multipart/mixed; boundary="----------=_1233105911-29719-673" |
X-Mailer: | MIME-tools 5.427 (Entity 5.427) |
Charset: | utf8 |
Content-Length: | 0 |
Content-Type: | text/plain |
Content-Disposition: | inline |
Content-Transfer-Encoding: | binary |
X-RT-Original-Encoding: | iso-8859-1 |
Content-Length: | 0 |
Content-Type: | application/x-perl; name="test_c3_par.pl" |
Content-Disposition: | inline; filename="test_c3_par.pl" |
Content-Transfer-Encoding: | base64 |
Content-Length: | 203 |
#!/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 |
MIME-Version: | 1.0 |
Content-Type: | multipart/mixed; boundary="----------=_1233105865-29719-672" |
X-Mailer: | MIME-tools 5.427 (Entity 5.427) |
Charset: | utf8 |
Content-Length: | 0 |
Content-Type: | text/plain |
Content-Disposition: | inline |
Content-Transfer-Encoding: | binary |
X-RT-Original-Encoding: | iso-8859-1 |
Content-Length: | 0 |
Content-Type: | application/octet-stream; name="foobar.par" |
Content-Disposition: | inline; filename="foobar.par" |
Content-Transfer-Encoding: | base64 |
Content-Length: | 836 |
Message body not shown because it is not plain text.