[Columbus-pm] use lib and BEGIN @INC

Jonathan Hogue jon at hogue.org
Fri Nov 12 15:24:15 PST 2010


> What is the benefit of
> BEGIN { unshift @INC, 'foo'; }
> over
>
> use lib 'foo';  ?
>


BEGIN {
  if( $ENV{SOME_THING} ) {
    unshift( @INC, $ENV{SOME_THING} );
  }
}

The code I'm working on uses environment variables for EVERYTHING, but
a lot of the environment variables are only set when you run in prod.
Cause the 90's were cool.


More information about the Columbus-pm mailing list