Works great.  Thank you.  

You're correct about it not working like I had said it was.  The module was
in the same directory as the script so was found regardless of the "use lib"
statement not working.

-----Original Message-----
From: Jeff 'japhy' Pinyan [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 07, 2002 1:03 PM
To: Carl Schoeneman
Cc: [EMAIL PROTECTED]
Subject: Re: Empty compile time value given to use lib

On Mar 7, Carl Schoeneman said:

>I'm using "use lib" dynamically:
>
>    $script_dir = get_lib();
>    use lib "$script_dir";
>
>This works but generates the warning "Empty compile time value given to use
>lib."  Is there any way to supress this message without disabling warnings
>entirely?

No, it does not "work".  $script_dir is undef at compile-time.

  $script_dir = get_lib();

doesn't happen until run-time.  Solution:

  sub get_lib { ... }
  use lib get_lib();

or:

  sub get_lib { ... }
  BEGIN { $script_dir = get_lib(); }
  use lib $script_dir;

--
Jeff "japhy" Pinyan      [EMAIL PROTECTED]      http://www.pobox.com/~japhy/
RPI Acacia brother #734   http://www.perlmonks.org/   http://www.cpan.org/
** Look for "Regular Expressions in Perl" published by Manning, in 2002 **
<stu> what does y/// stand for?  <tenderpuss> why, yansliterate of course.
[  I'm looking for programming work.  If you like my work, let me know.  ]

Reply via email to