$FIND_VERSION $ERROR $CHECK_INC_HASH];
use Exporter;
@ISA = qw[Exporter];
- $VERSION = '0.26';
+ $VERSION = '0.28';
$VERBOSE = 0;
$FIND_VERSION = 1;
$CHECK_INC_HASH = 0;
Full path to the file that contains the module
+=item dir
+
+Directory, or more exact the C<@INC> entry, where the module was
+loaded from.
+
=item version
The version number of the installed module - this will be C<undef> if
}
}
+ ### store the directory we found the file in
+ $href->{dir} = $dir;
+
### files need to be in unix format under vms,
### or they might be loaded twice
$href->{file} = ON_VMS
if( $FIND_VERSION ) {
my $in_pod = 0;
- while (local $_ = <$fh> ) {
+ while ( my $line = <$fh> ) {
### stolen from EU::MM_Unix->parse_version to address
### #24062: "Problem with CPANPLUS 0.076 misidentifying
### versions after installing Text::NSP 1.03" where a
### VERSION mentioned in the POD was found before
### the real $VERSION declaration.
- $in_pod = /^=(?!cut)/ ? 1 : /^=cut/ ? 0 : $in_pod;
+ $in_pod = $line =~ /^=(?!cut)/ ? 1 :
+ $line =~ /^=cut/ ? 0 :
+ $in_pod;
next if $in_pod;
### try to find a version declaration in this string.
- my $ver = __PACKAGE__->_parse_version( $_ );
+ my $ver = __PACKAGE__->_parse_version( $line );
if( defined $ver ) {
$href->{version} = $ver;
use constant ON_VMS => $^O eq 'VMS';
-use lib "$FindBin::Bin/../lib";
-use lib "$FindBin::Bin/to_load";
+use lib File::Spec->catdir($FindBin::Bin, qw[.. lib] );
+use lib File::Spec->catdir($FindBin::Bin, q[to_load] );
use_ok( 'Module::Load::Conditional' );
ok( $rv->{uptodate}, q[Verify self] );
is( $rv->{version}, $Module::Load::Conditional::VERSION,
q[ Found proper version] );
+ ok( $rv->{dir}, q[ Found directory information] );
+
+ { my $dir_re = qr/^$rv->{dir}/i;
+ like( $rv->{file}, $dir_re,
+ q[ Dir subset of file path] );
+ }
### break up the specification
my @rv_path = do {
File::Spec::Unix->catfile(@rv_path),
q[ Found proper file]
);
+
+
}