#!c:\perl\bin\perl
# History :Version       :DATE      :Coder       : Patch No
#         :50-04-40/00-02:2005.09.19:T.Kishimoto :USE22226024 PORT80 Block

sub getenv(){
my $envfile, $envfile_bak ;
my @tmp, @buf, $i ;

my($itemno) = @_;

$envfile="csv/env.csv";
$envfile_bak="csv/env.bak";
unless(open(ENV,"< $envfile")){
    sleep 1;
    unless(open(ENV,"< $envfile")){
        sleep 1;
        unless(open(ENV,"< $envfile")){
            unless(open(ENV,"< $envfile_bak")){
                {`echo env.csv File Open(for READ) Error. No Change. >log/httpdconf.log`; }
                exit;
            }
        }
    }
}

while(<ENV>){
    chop;
    @tmp=split(/,/);
    foreach $i (0 .. $#tmp){
        $buf[$i]=$tmp[$i];
    }
    last;
}
close(ENV);
return $buf[$itemno];

}1;
