Mike Blezien <[EMAIL PROTECTED]> wrote:

: I need to add to an existing hash, $params, that reads from a
: tempfile. The code looks something like this,
: 
: my $cgi = new CGI();
: my $params = $cgi->Vars();

    My first question would be: Why use the $params at all, but
many people like to do that sort of thing.


my $file = '/some/temp_file';
open TMP, $file or die qq(Cannot open "$file": $!);

my $cgi = CGI->new();
while ( <TMP> ) {
    chomp;
    my( $name, $value )  = split /::/;
    $cgi->param( $name, $value );
}

close TMP;

my $params = $cgi->Vars();


    Or if it is clear to you:

while ( <TMP> ) {
    chomp;
    $cgi->param( split /::/ );
}


HTH,

Charles K. Clarkson
-- 
Mobile Homes Specialist
254 968-8328


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to