arthurg has asked for the wisdom of the Perl Monks concerning the following question:
and says that require "Has semantics similar to the following subroutine":BEGIN { require Module; Module->import( LIST ); }
sub require { my ($filename) = @_; if ( exists $INC{$filename} ) { return 1 if $INC{$filename}; die "Compilation failed in require"; } my ( $realfilename, $result ); ITER: { foreach $prefix (@INC) { $realfilename = "$prefix/$filename"; if ( -f $realfilename ) { $INC{$filename} = $realfilename; $result = do $realfilename; last ITER; } } die "Can't find $filename in \@INC"; } if ($@) { $INC{$filename} = undef; die $@; } elsif ( !$result ) { delete $INC{$filename}; die "$filename did not return true value"; } else { return $result; } }
Given this, what does "Can't locate loadable object for module X in @INC (@INC contains: ... )" mean? That is, which of the errors that require can return will return it?
BTW, a comprehensive repository of Perl core error messages would be great.
Thanks
Arthur
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Can't locate loadable object for module X in @INC (@INC contains: ... )
by chromatic (Archbishop) on Nov 17, 2009 at 04:15 UTC | |
by arthurg (Acolyte) on Nov 17, 2009 at 15:59 UTC | |
by Anonymous Monk on Nov 17, 2009 at 17:05 UTC | |
by Anonymous Monk on Sep 08, 2011 at 16:25 UTC | |
by Anonymous Monk on Aug 14, 2014 at 23:56 UTC | |
by localshop (Monk) on Oct 06, 2015 at 17:50 UTC | |
by Anonymous Monk on Oct 07, 2015 at 01:22 UTC |