[26283] in Perl-Users-Digest
Perl-Users Digest, Issue: 8465 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Sep 28 14:05:44 2005
Date: Wed, 28 Sep 2005 11:05:04 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Wed, 28 Sep 2005 Volume: 10 Number: 8465
Today's topics:
Re: Use of hash variables in module call - puzzling beh <news@lawshouse.org>
Re: Use of hash variables in module call - puzzling beh xhoster@gmail.com
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 28 Sep 2005 15:23:28 +0100
From: Henry Law <news@lawshouse.org>
Subject: Re: Use of hash variables in module call - puzzling behaviour
Message-Id: <1127917409.41573.0@doris.uk.clara.net>
Anno Siegel wrote:
> Henry Law <news@lawshouse.org> wrote in comp.lang.perl.misc:
>>Using the variables in the hash causes errors in Mail::Internet; using
>>equivalent variables from a hash created from data in the program does
>>not cause the same error. Odder still, the error doesn't occur at all
>>when I run the same program under ActiveState Perl in Windows.
> Are the strings in the hash returned from XMLin normal scalars?
> They *could* be objects with overloaded stringification or tied
> variables in which case something might rub them the wrong way.
Worth a look. I ran the program under Perl debug and "x"ed the two hashes:
DB<2> x %g_server
0 'adminuser'
1 'postmaster@lawshouse.org'
2 'smtpserver'
3 'smtp.bt.net'
4 'localuser'
5 'nfb@neptune.lawshouse.org'
DB<3> x %G_server
0 'adminuser'
1 'postmaster@lawshouse.org'
2 'smtpserver'
3 'smtp.bt.net'
4 'localuser'
5 'nfb@neptune.lawshouse.org'
... which looks OK to me, unless I'm missing something.
> Swap the "Sending with G_server variables" and "Sending with g_server
> variables" blocks. It could be the second call that fails instead of
> depending on which hash is used. Perhaps one of the objects involved
> ($mail or $header) is damaged after the first use.
I had already tried that; it's the $g_server version that fails
consistently.
> Try mixed calls, for example taking adminuser from %G_server and the
> others from %g_server.
That's a good idea. I'll try when I'm at home this evening.
> Check versions (Perl, the modules) on the linux box against the
> windows one.
I know the Perl versions are the same; I'll hadn't thought about the
modules versions and will check.
> That's all that comes to mind for now.
Thanks; very helpful.
I have added a couple of remarks
> (untested) to the code below, but these are stylistic and have nothing
> to do with debugging the problem.
... which are welcome, thank you. Style is, well, a stylistic thing.
--
Henry Law <>< Manchester, England
------------------------------
Date: 28 Sep 2005 14:58:23 GMT
From: xhoster@gmail.com
Subject: Re: Use of hash variables in module call - puzzling behaviour
Message-Id: <20050928105823.784$cz@newsreader.com>
Henry Law <news@lawshouse.org> wrote:
> Anno Siegel wrote:
>
> > Swap the "Sending with G_server variables" and "Sending with g_server
> > variables" blocks. It could be the second call that fails instead of
> > depending on which hash is used. Perhaps one of the objects involved
> > ($mail or $header) is damaged after the first use.
> I had already tried that; it's the $g_server version that fails
> consistently.
That would have been my first recommendation. Second would be to abstract
away the repeated code, just to make sure there is not some subtle (or
invisible funky character) difference in the code which executes under the
two hashes.
foreach my $hashref (\%g_server, \%G_server) {
# etc.
@recipients = $mail->smtpsend(Host=>$hashref->{smtpserver},
MailFrom=>$hashref->{localuser},
To=>$hashref->{adminuser}
);
# etc.
};
Xho
--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc. For subscription or unsubscription requests, send
#the single line:
#
# subscribe perl-users
#or:
# unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.
NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.
#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V10 Issue 8465
***************************************