On Jul 22, 11:59 pm, [EMAIL PROTECTED] (Chris Pax) wrote:
> I know that if i use: use lib "/path/to/dir" works. but when I try to
> use a variable it does not work.
> here is my code:
> @dirs = split /\// , $0;
> delete $dirs[-1];
> my $runningDir = join "/",@dirs;
> $runningDir.="/";
> use lib $ru
Mr. Shawn H. Corey wrote:
Is it going to waste so much time that you can't call dirname() twice?
If so, try:
#!/usr/bin/perl
use strict;
use warnings;
use vars qw( $dir );
use File::Basename;
use lib ( $dir = dirname( $0 ) );
print "$dir\n";
print "@INC\n";
__END__
--
Just my 0.0002
Adriano Ferreira wrote:
On 7/23/07, Mr. Shawn H. Corey <[EMAIL PROTECTED]> wrote:
use File::Basename;
use lib dirname( $0 );
Pay attention to the fact that the solution by Shawn does not work
also if you try to do something like this:
use File::Basename;
my $dir = dirname( $0 );
use lib $dir;
On 7/23/07, Adriano Ferreira <[EMAIL PROTECTED]> wrote:
On 7/23/07, Mr. Shawn H. Corey <[EMAIL PROTECTED]> wrote:
snip
> use File::Basename;
> use lib dirname( $0 );
Pay attention to the fact that the solution by Shawn does not work
snip
Um, yes it does. At least with 5.8.8. I thought I re
On 7/23/07, Mr. Shawn H. Corey <[EMAIL PROTECTED]> wrote:
Chris Pax wrote:
> I know that if i use: use lib "/path/to/dir" works. but when I try to
> use a variable it does not work.
> here is my code:
> @dirs = split /\// , $0;
> delete $dirs[-1];
> my $runningDir = join "/",@dirs;
> $runningDir.
Chris Pax wrote:
I know that if i use: use lib "/path/to/dir" works. but when I try to
use a variable it does not work.
here is my code:
@dirs = split /\// , $0;
delete $dirs[-1];
my $runningDir = join "/",@dirs;
$runningDir.="/";
use lib $runningDir;
use File::Basename;
use lib dirname( $0 );