Wednesday, September 26, 2012

Put data in a file

# Function Name    : store_data
# Input            : filename with path and string data to be stored
# Output        : none
# Description    : This funtion will create the given file and store given data in it.
sub store_data($$)
{
    my ($file, $str) = @_;
    $file = convertSlash($file);
    if (-e $file)
    {
        open (FO, ">>$file");
    }
    else
    {
        open (FO, ">$file");
    }
    print FO $str;
    close (FO);
}

No comments:

Post a Comment