Re: 'Use Lib' problem...
- From: japhy@xxxxxxxxxxxx (Jeff 'japhy' Pinyan)
- Date: Tue, 26 Jul 2005 21:49:54 -0400 (EDT)
On Jul 26, Tony Frasketi said:
$ENV{HOME} = 'home/tony/cgi-bin'; # My cgi-bin directory
Are you sure there shouldn't be a / at the beginning of that?
use lib "$ENV{HOME}/pm"; # Add my personal perl module directory
The problem is that 'use lib' happens at compile-time, but your assignment to $ENV{HOME} doesn't happen until run-time. A simple fix in your case is:
BEGIN {
$ENV{HOME} = "/home/tony/cgi-bin";
}
use lib "$ENV{HOME}/pm";The BEGIN { } block forces its contents to be executed at compile-time.-- Jeff "japhy" Pinyan % How can we ever be the sold short or RPI Acacia Brother #734 % the cheated, we who for every service http://japhy.perlmonk.org/ % have long ago been overpaid? http://www.perlmonks.org/ % -- Meister Eckhart .
- References:
- 'Use Lib' problem...
- From: Tony Frasketi
- 'Use Lib' problem...
- Prev by Date: Re: 'Use Lib' problem...
- Next by Date: Re: skip/delete lines with dup keys
- Previous by thread: Re: 'Use Lib' problem...
- Next by thread: Re: 'Use Lib' problem...
- Index(es):