Tuesday, August 7, 2012

Setting Environment variable

# Function Name    : setEnv
# Input            : key and value
# Output        : none
# Description    : This funtion will set environment variable for current and child process
# Created By    : Rinkesh Bansal
#
sub setEnv($$)
{
    my ($key, $value) = @_;
    my $delimiter;
    my $os = $^O;
    if ($os eq "MSWin32")
    {
        $delimiter = ";";
    }
    else
    {
        $delimiter = ":";
    }

    $ENV{$key}=$ENV{$key} . $delimiter . $value;
}

No comments:

Post a Comment