develooper Front page | perl.beginners | Postings from February 2002

Anonymous hash question

Thread Next
Nikola Janceski
February 12, 2002 13:00
Anonymous hash question
Message ID:
I am using a module function (method) that requires an anonymous hash as the
first parameter.

ie. $sender->OpenMultipart({from => $FORM{'from'}, to => $FORM{'to'}, cc =>
                       subject => $FORM{'subject'} } ) || die

but sometimes $FORM{'cc'} contains nothing and the module complains about

I want to be able to pass the method an anonymous hash.. can someone correct
note: I have already done checking on the contents of $FORM so the values
are real (true values) or "" (false);

my %TEMP;
foreach $key ( qw( from to cc subject ) ){
	$TEMP{$key} = $FORM{$key} if $FORM{$key}

$sender->OpenMultipart( { %TEMP } ) || die "$Mail::Sender::Error\n";

Nikola Janceski
Summit Systems, Inc.

Prosperity doth best discover vice, but adversity doth best discover virtue.
-- Francis Bacon

The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About