in reply to (duplicate) Problem pushing into @INC

BEGIN blocks are done just then ... at the beginning. So in your example, $home is interpolated as a null string. Try:

BEGIN { push( @INC, $ENV{HOME} . "/prod_support/scripts" ); }

Or another (more modern) way:

use lib "$ENV{HOME}/prod_support/scripts";

-derby

Replies are listed 'Best First'.
Re: Re: Problem pushing into @INC
by chip (Curate) on Jul 08, 2003 at 19:32 UTC
    While use lib is nice, it doesn't push; it unshifts. There is no pragma that unshifts, AFAIK. So the push in BEGIN is pretty much the only option.

        -- Chip Salzenberg, Free-Floating Agent of Chaos

      Sure. I assumed (wrongly probably) that in this particular instance the poster didn't really care about controlling the loading (ala @INC positioning) but was more concerned about getting the unique project specific stuff into @INC.

      -derby