in reply to File/Directory hierarchy for devel/stable versions

What's wrong with sticking this (possibly in a BEGIN block) at the top of each file, and never having to worry about it again?
my $code_status; if ( -f './status-devel' ) { $code_status = 'devel'; } else { $code_status = 'stable'; } use lib "/var/www/intranet/${code_status}/lib";


Update: Fixed the variable in the path per chromatic's good catch, and replaced "an INIT block" with "a BEGIN block", since that's what it's called in Perl. ;-)

Christopher E. Stith
use coffee;

Replies are listed 'Best First'.
Re: Re: File/Directory hierarchy for devel/stable versions
by chromatic (Archbishop) on May 20, 2003 at 03:58 UTC

    The fact that his directory names probably don't contain curly braces. :)

    use lib "/var/www/intranet/$code_status/lib"; # or use lib "/var/www/intranet/${code_status}/lib";