in reply to Problem pushing into @INC

  1. use lib is better.
  2. BEGIN blocks execute before anything else, including code above it.
use lib "$ENV{HOME}/prod_support/scripts"; use myLib; #### Or ... BEGIN { $home = $ENV{HOME}; push @INC, "$home/prod_support/scripts"; } use myLib;
On a separate note, you should be using strict and warnings.

------
We are the carpenters and bricklayers of the Information Age.

Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.

Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.

Replies are listed 'Best First'.
Re: Re: Problem pushing into @INC
by chip (Curate) on Jul 08, 2003 at 19:33 UTC
    While use lib is fine, it's not a push, it's an unshift. This may or may not be important to the final task.

        -- Chip Salzenberg, Free-Floating Agent of Chaos