Tobias Eichner wrote:
Gunnar Hjalmarsson wrote:
Both those methods assume that the path to the directory where the program resides equals the current working directory. That's often the case, but not always.

Isn't the "working directory" always the path where the program executes from ?

No. Please get used to the thought. ;-)

Maybe there is an other hint ?

It just struck me: The __FILE__ variable. Would this solution serve your needs?

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

--
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