[25980] in Perl-Users-Digest
Perl-Users Digest, Issue: 8199 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jun 24 14:05:25 2005
Date: Fri, 24 Jun 2005 11:05:06 -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 Fri, 24 Jun 2005 Volume: 10 Number: 8199
Today's topics:
Re: [OT] Re: "use CGI " hangs "CGI time out " <tadmc@augustmail.com>
ImageMagick <""alexjaquet\"@[no spam]msn.com">
Package fails because it refers to variable in main pro <lawshouse.public@btconnect.com>
Re: Package fails because it refers to variable in main (Anno Siegel)
Send Email <mjs_ops@gmx.net>
Re: Send Email <jurgenex@hotmail.com>
Re: Send Email (Anno Siegel)
Re: Send Email <tadmc@augustmail.com>
Re: Send Email <mjs_ops@gmx.net>
Re: Send Email <mjs_ops@gmx.net>
Re: Send Email <apeiron+usenet@coitusmentis.info>
Re: Send Email xhoster@gmail.com
Re: Send Email <mjs_ops@gmx.net>
Re: Send Email (Anno Siegel)
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 24 Jun 2005 08:23:09 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: [OT] Re: "use CGI " hangs "CGI time out "
Message-Id: <slrndbo29t.8ko.tadmc@magna.augustmail.com>
Alfred Z. Newmane <a.newmane.remove@eastcoastcz.com> wrote:
> Tad McClellan wrote:
>> Alfred Z. Newmane <a.newmane.remove@eastcoastcz.com> wrote:
>>
>>
>>> reason I added comp.lang.c to the ng list
>> Did you note in the message body that you were exanding
>> the Newsgroups header?
>
>
> My apologies. I didn't seem necessary
>> Not doing so is well established as being a rude thing to do.
>
> How so?
Imagine you are talking to your boss, who is in the conference room,
on the phone.
Think it might lead to embarrassment, or worse, if he was to switch
on the speaker phone without your knowledge?
And in fact, there was just such a mixup in this thread as a result
of your silently expanding the thread's audience.
> If you are following a topic of interest (even though it may
> have branched off from the central topic of the tread into a sub
> thread), how would you like it if you were suddenly and unexpected cut
> off from replies before realizing they were redirected to another group?
The "prime directive" of effective communication is considering your
audience. That is hard to do when the audience's composition has
changed dramatically without your being aware of it.
> Again, I apologize for not reporting the newgroups header change.
'Nuff said then.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Fri, 24 Jun 2005 17:04:51 +0200
From: Alexandre Jaquet <""alexjaquet\"@[no spam]msn.com">
Subject: ImageMagick
Message-Id: <42bc2119$0$1152$5402220f@news.sunrise.ch>
Hi,
I've a trouble when I want to use ImageMagick on windows xp I've
installed PerlMagick with theses instructions :
http://www.dylanbeattie.net/magick/howto.html
but when I try the test script I got the following errors :
[error] [client 127.0.0.1] Premature end of script headers: imagedemo1.pl
[error] [client 127.0.0.1] Can't load
'C:/indigoperl/perl/site/lib/auto/Image/Magick/Magick.dll' for module
Image::Magick: load_file:Le module spécifié est introuvable at
C:/indigoperl/perl/lib/DynaLoader.pm line 230.
[error] [client 127.0.0.1] at
C:/indigoperl/apache/cgi-bin/imagedemo1.pl line 4
[error] [client 127.0.0.1] Compilation failed in require at
C:/indigoperl/apache/cgi-bin/imagedemo1.pl line 4.
[error] [client 127.0.0.1] BEGIN failed--compilation aborted at
C:/indigoperl/apache/cgi-bin/imagedemo1.pl line 4.
the file Magick.dll existe in the directory :
C:/indigoperl/perl/site/lib/auto/Image/Magick/
thanks for your advice
------------------------------
Date: Fri, 24 Jun 2005 16:51:35 +0100
From: Henry Law <lawshouse.public@btconnect.com>
Subject: Package fails because it refers to variable in main program - how to fix?
Message-Id: <o5aob1ho9b5v8db4eoi9pa7u9tbal7nqqu@4ax.com>
I have a main program and two packages. The first package loads up a
number of system-wide variables and exposes them to the program that
uses them. The second package has utility subroutines, some of which
need access to variables exposed by the first package. For example,
the log file name is a system-wide variable which is exposed as
"global" and in the "Utilities" package there's a routine that writes
log records.
I can't work out how to get the Utilities package to see the "global"
variables, despite reading perlmod fairly carefully; some pointers to
relevant bits of doc would be helpful.
This works, and shows that global variables are exposed:
----------------------------------------------------
#! C:\Perl\bin\Perl.exe
use strict;
use warnings;
use NFB::ClientGlobal(':all');
#use NFB::Utilities('logrec');
print "Log file name is $g_logfile\n";
----------------------------------------------------
F:\>tryit.pl
Log file name is F:\NFB\nfblog.txt
F:\>
I'm not going to paste in the whole of NFB::Utilities, but the key
lines are these:
sub logrec {
open (LOGFILE,">>main::$g_logfile") or die "etc..";
If I "use" it from the program above the error message is
Global symbol "$g_logfile" requires explicit package name at
NFB/Utilities.pm line 48.
In other words "logrec" is not seeing the definition of $g_logfile; as
you can see I have been experimenting with explicit package names -
including naming the "NFB::ClientGlobal" package that exposed the
$g_logfile variable in the first place, but all without success.
Coaching, please!
--
Henry Law <>< Manchester, England
------------------------------
Date: 24 Jun 2005 17:44:47 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Package fails because it refers to variable in main program - how to fix?
Message-Id: <d9hgqf$j74$1@mamenchi.zrz.TU-Berlin.DE>
Henry Law <news@lawshouse.org> wrote in comp.lang.perl.misc:
> I have a main program and two packages. The first package loads up a
> number of system-wide variables and exposes them to the program that
> uses them. The second package has utility subroutines, some of which
> need access to variables exposed by the first package. For example,
> the log file name is a system-wide variable which is exposed as
> "global" and in the "Utilities" package there's a routine that writes
> log records.
See how global variables mean trouble? Could you make the logfile a
parameter of the logrec() utility? It would have saved you this kind
of headache.
If it must stay global, Utilities should import it from ClientGlobal
on its own instead of relying on main:: to do it and making a cross-
package access. main:: can import it as well, if it needs to know.
That's the purpose of a configuration module like ClientGlobal that
whichever part of the program can consistently import what it needs
from it.
However, while roundabout, your method would work as well. You simply
haven't got the cross-package variable syntax right. See code correction
below.
> I can't work out how to get the Utilities package to see the "global"
> variables, despite reading perlmod fairly carefully; some pointers to
> relevant bits of doc would be helpful.
>
> This works, and shows that global variables are exposed:
> ----------------------------------------------------
> #! C:\Perl\bin\Perl.exe
>
> use strict;
> use warnings;
>
> use NFB::ClientGlobal(':all');
> #use NFB::Utilities('logrec');
>
> print "Log file name is $g_logfile\n";
> ----------------------------------------------------
>
> F:\>tryit.pl
> Log file name is F:\NFB\nfblog.txt
>
> F:\>
>
> I'm not going to paste in the whole of NFB::Utilities, but the key
> lines are these:
>
> sub logrec {
> open (LOGFILE,">>main::$g_logfile") or die "etc..";
It's $main::g_logfile, not main::$g_logfile. That's all that is wrong.
[snip rest of code]
Anno
------------------------------
Date: Fri, 24 Jun 2005 10:57:11 -0000
From: Marcos <mjs_ops@gmx.net>
Subject: Send Email
Message-Id: <op.ssvfdlwc4v4sy3@afrodite.network>
Hello,
I work with PHP and I always have many emails to send for the users.
Currently I use the function mail of php to send this emails, but
this is not good because the php script have one short timeout, then
I'd like create one perl script called by my PHP script. I need know how
the perl work with emails, and how as I can work with it to send emails.
Since already been thankful.
--
Marcos José Setim
________________________________________
Usando o M2 do Opera: http://www.opera.com/m2/
------------------------------
Date: Fri, 24 Jun 2005 14:00:41 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Send Email
Message-Id: <dmUue.3$xL1.0@trnddc08>
Marcos wrote:
[...]
>I need know
> how the perl work with emails, and how as I can work with it to send
> emails.
Did you check the Perl FAQ already ("perldoc -q mail")?
jue
------------------------------
Date: 24 Jun 2005 14:06:21 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Send Email
Message-Id: <d9h40t$bbn$2@mamenchi.zrz.TU-Berlin.DE>
Marcos <mjs_ops@gmx.net> wrote in comp.lang.perl.misc:
> Hello,
>
> I work with PHP and I always have many emails to send for the users.
> Currently I use the function mail of php to send this emails, but
> this is not good because the php script have one short timeout, then
> I'd like create one perl script called by my PHP script. I need know how
> the perl work with emails, and how as I can work with it to send emails.
What makes you think a Perl script will have a longer timeout than a
PHP script?
As to sending mail, start with "perldoc -q 'send mail'" for first
suggestions. You may want to look at other modules on CPAN later.
Anno
------------------------------
Date: Fri, 24 Jun 2005 09:16:55 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Send Email
Message-Id: <slrndbo5en.8uf.tadmc@magna.augustmail.com>
Marcos <mjs_ops@gmx.net> wrote:
> I need know how
> the perl work with emails
You are expected to check the Perl FAQ *before* posting
to the Perl newsgroup.
perldoc -q mail
How do I parse a mail header?
How do I check a valid mail address?
How do I return the user's mail address?
How do I send mail?
How do I use MIME to make an attachment to a mail message?
How do I read mail?
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Fri, 24 Jun 2005 11:27:43 -0000
From: Marcos <mjs_ops@gmx.net>
Subject: Re: Send Email
Message-Id: <op.ssvgshcp4v4sy3@afrodite.network>
Sorry,
I did not check the FAQ..
> Marcos wrote:
> [...]
>> I need know
>> how the perl work with emails, and how as I can work with it to send
>> emails.
>
> Did you check the Perl FAQ already ("perldoc -q mail")?
>
> jue
>
------------------------------
Date: Fri, 24 Jun 2005 11:33:10 -0000
From: Marcos <mjs_ops@gmx.net>
Subject: Re: Send Email
Message-Id: <op.ssvg1kb34v4sy3@afrodite.network>
> What makes you think a Perl script will have a longer timeout than a
> PHP script?
The scripts PHP in its majority are defined with one max_execution_time of
30 seconds in php.ini, I think that perl script can be running for the
time that I need in the server why it does not have this limitation.
My idea is certain?
Thanks.
------------------------------
Date: 24 Jun 2005 15:30:43 GMT
From: Christopher Nehren <apeiron+usenet@coitusmentis.info>
Subject: Re: Send Email
Message-Id: <slrndbo9p8.250m.apeiron+usenet@prophecy.dyndns.org>
On 2005-06-24, Marcos scribbled these
curious markings:
> The scripts PHP in its majority are defined with one max_execution_time of
> 30 seconds in php.ini, I think that perl script can be running for the
> time that I need in the server why it does not have this limitation.
<OT>
A server or a browser can timeout a request for a Perl program just as
easily as PHP can apply its own timeout.
</OT>
Best Regards,
Christopher Nehren
--
I abhor a system designed for the "user", if that word is a coded
pejorative meaning "stupid and unsophisticated". -- Ken Thompson
If you ask the wrong people questions, you get "Joel on Software".
Unix is user friendly. However, it isn't idiot friendly.
------------------------------
Date: 24 Jun 2005 15:59:07 GMT
From: xhoster@gmail.com
Subject: Re: Send Email
Message-Id: <20050624115907.449$ZM@newsreader.com>
Marcos <mjs_ops@gmx.net> wrote:
> > What makes you think a Perl script will have a longer timeout than a
> > PHP script?
>
> The scripts PHP in its majority are defined with one max_execution_time
> of 30 seconds in php.ini, I think that perl script can be running for the
> time that I need in the server why it does not have this limitation.
>
> My idea is certain?
I don't know PHP, but I suspect that figuring out how to change the its
timeout would be easier than learning a whole new language. Also, if php
calls Perl synchronously and then times out, it may take Perl down with it.
Why does it take >30 seconds to send an email?
Xho
--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
------------------------------
Date: Fri, 24 Jun 2005 13:36:42 -0000
From: Marcos <mjs_ops@gmx.net>
Subject: Re: Send Email
Message-Id: <op.ssvmrgro4v4sy3@afrodite.network>
> I don't know PHP, but I suspect that figuring out how to change the its
> timeout would be easier than learning a whole new language.
No. Only the administrator of server can change the file php.ini :( .. and
I would like to learn Perl for use in my projects.
> Also, if php
> calls Perl synchronously and then times out, it may take Perl down with
> it.
>
I think that No. I found this solution in php.net, that it allows to
execute one script Perl without ties it php to it...:
http://br.php.net/exec
#!/usr/bin/perl
fork and exit 1;
> Why does it take >30 seconds to send an email?
They are several e-mails, of my database :( For few emails I use the
htmlmimemail (php).
--
Thanks,
Marcos José Setim
________________________________________
Usando o M2 do Opera: http://www.opera.com/m2/
------------------------------
Date: 24 Jun 2005 17:14:41 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Send Email
Message-Id: <d9hf21$i41$1@mamenchi.zrz.TU-Berlin.DE>
Marcos <mjs_ops@gmx.net> wrote in comp.lang.perl.misc:
[in reply to Xho, as I have to add]
> > Why does it take >30 seconds to send an email?
>
> They are several e-mails, of my database...
Can't say I like the sound of this...
Anno
------------------------------
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 8199
***************************************