Tobias Eichner wrote:
@Gunnar Hjalmarsson:

     use File::Spec;
     my ($vol, $progdir);
     BEGIN { ($vol, $progdir) = File::Spec->splitpath( __FILE__ ) }
     use lib File::Spec->catpath( $vol, $progdir, 'libraries' );

At http://perldoc.perl.org/perldata.html it is stated that __FILE__ contains the current filename... can it be assumed that this includes the entire path at all platforms as well ?

Well, until you asked I thought that was the case... Maybe somebody else knows for sure.

Since I'm not sure about the meaning of "use lib...", could I also write this one (I'm currently not on a computer with Perl available):

unshift(@INC,File::Spec->catpath($vol,$progdir,'mylib_directory')

Sure, but note that you need to put it in a BEGIN block if you want it to happen at compile time.

I'd suggest that you take this opportunity to check out the lib pragma.

    perldoc lib

It's not rocket science. ;-)

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to