[17479] in Perl-Users-Digest
Perl-Users Digest, Issue: 4899 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Nov 16 03:05:40 2000
Date: Thu, 16 Nov 2000 00:05:13 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <974361912-v9-i4899@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Thu, 16 Nov 2000 Volume: 9 Number: 4899
Today's topics:
about Sendmail's return <lukus@hongkong.com>
Re: about Sendmail's return <not.my.real.email@bellglobal.com>
capture informix tables into text files sshark97@my-deja.com
Re: Date (Ameen Dausha)
Re: Date (Ameen Dausha)
Re: Duplicate Records (Garry Williams)
Re: Duplicate Records (Garry Williams)
Re: Exporting variables from modules (Garry Williams)
Image Gallery Script <drinkbeer3@hotmail.com>
Re: Image Gallery Script <Thomas.Mager@nikocity.de>
Re: IP geography (Martien Verbruggen)
Re: IP geography (Iain Chalmers)
Re: Line Editing <wyzelli@yahoo.com>
Re: Mail::Tools from activestate doesnt work on win32 ? <randy@theory.uwinnipeg.ca>
Re: Mail::Tools from activestate doesnt work on win32 ? dtbaker_dejanews@my-deja.com
Re: Mail::Tools from activestate doesnt work on win32 ? dtbaker_dejanews@my-deja.com
Re: Mail::Tools from activestate doesnt work on win32 ? <GCD00051@nifty.ne.jp>
Re: Malformed header resulting from use of mkdir() descacsoft@my-deja.com
Re: No idea about perl, Long post, short question <wyzelli@yahoo.com>
Re: No idea about perl, Long post, short question (Martien Verbruggen)
Re: No idea about perl, Long post, short question <siwatkins@iee.org>
Re: Prevent web page time out during CGI execution? dtbaker_dejanews@my-deja.com
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 16 Nov 2000 13:05:11 +0800
From: "Regent Linus" <lukus@hongkong.com>
Subject: about Sendmail's return
Message-Id: <8uvpru$80j3@imsp212.netvigator.com>
Hi,
I am going to use sendmail for sending emails to my site's members for
informing updated information, however I find there would be returned mails
if their submitted emails are invalid, it would creat a file in
var/spool/mqueue with content liked:
><123@abc.bcd.net>
>Sorry, I couldn't find any host named abc.bcd.net. (#5.1.2)
How to avoid this returning message.
------------------------------
Date: Thu, 16 Nov 2000 05:21:05 GMT
From: "MNJP" <not.my.real.email@bellglobal.com>
Subject: Re: about Sendmail's return
Message-Id: <59KQ5.74677$1C6.3215777@news20.bellglobal.com>
Use a distribution list like majordomo which will automatically handle
bounced messages and unsubscribe them from the list.
(oh, it will also handle subscriptions, verifying email address, digests,
etc, etc, etc.. and it'll all be automated too)
"Regent Linus" <lukus@hongkong.com> wrote in message
news:8uvpru$80j3@imsp212.netvigator.com...
> Hi,
>
> I am going to use sendmail for sending emails to my site's members for
> informing updated information, however I find there would be returned
mails
> if their submitted emails are invalid, it would creat a file in
> var/spool/mqueue with content liked:
>
> ><123@abc.bcd.net>
> >Sorry, I couldn't find any host named abc.bcd.net. (#5.1.2)
>
> How to avoid this returning message.
>
>
------------------------------
Date: Thu, 16 Nov 2000 07:34:57 GMT
From: sshark97@my-deja.com
Subject: capture informix tables into text files
Message-Id: <8v02n2$p0s$1@nnrp1.deja.com>
Hi!
I want to capture some tables and put them into a text file using Perl5
(WinNT platform)-> ODBC (WinNT platform) -> Informix 7.x (HP-UX).
Everything was fine until I met this table with these columns, shown in
1 & 2.
percent_full char(10)
actual_weight char(17)
dtime datetime year to second --> 1
offset interval hour to minute --> 2
rel_flag char(1)
The output was BLANK, no fields was captured or what so ever. the ODBC
log says something like "Data truncated. Informix error -11003". I
increased the buffer size and I still cannot capture this table. any
pointers? thank you.
/lim/
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 16 Nov 2000 03:33:26 GMT
From: ameen @ dausha . net (Ameen Dausha)
Subject: Re: Date
Message-Id: <3a134ecd.105702146@news>
On Wed, 15 Nov 2000 14:16:31 -0000, "Dave Cross" <dave@dave.org.uk>
spat:
><ameen @ dausha . net (Ameen Dausha)> wrote in message
>news:3a127a51.51301822@news...
>> On Wed, 15 Nov 2000 09:27:57 -0000, "Dave Cross" <dave@dave.org.uk>
>> spat:
>>
>> >
>> ><ameen @ dausha . net (Ameen Dausha)> wrote in message
>> >news:3a11f48e.17053769@news...
>> >> On 15 Nov 2000 00:53:46 GMT, jobbey83@aol.com (JOBBEY83) spat:
>> >>
>> >> >Hi, I am a total newbie and I am wondering how I can calculate the
>> >current date
>> >> >mm/dd/yy. If it involves installing a module could you please direct
>me
>> >on how
>> >> >to do so?
>> >>
>> >> The CPAN Module "Date::Manip" is plenty powerful.
>> >
>> >Perhaps a little _too_ powerful for a task like this which can be
>> >accomplished very easily with localtime.
>>
>> Yes, buy with localtime don't you need to incriment the month and day?
>> Don't you need to handle the fact that this is Perl Year 100? Granted,
>> that can be handled by adding a few lines of code, but:
>>
>> use Date::Manip;
>>
>> $today = &DateCalc("today", "%m/%d/%y");
>
>Let's see what the author Date::Manip has to say on the subject (from
>perldoc Date::Manip):
>
>"Is Date::Manip the one you should be using? In my opinion, the answer is no
>about 90% of the time."
I looked at these documents:
http://search.cpan.org/doc/SBECK/DateManip-5.39/README
http://www.engelschall.com/ar/perldoc/pages/module/Date::Manip.html
Nothing containing this. As I lack the module in this environment, I
will have to check at work tomorrow.
>Let's see how really difficult it is with localtime:
>
>my @now = (localtime)[3 .. 5];
>my $date = sprintf('%02d/%02d%0d2', ++$now[2], $now[1], $now[3] % 100);
>
>Doesn't look that tricky to me.
Dave, I don't mean to be a pain, but, I tried your solution--by
cutting and pasting into a test script. Here is the script I used:
my @now = (localtime)[3 .. 5];
my $date = sprintf('%02d/%02d%0d2', ++$now[2], $now[1], $now[3] %
100);
print "Date=>$date<=\n";
The output is:
Date=>101/1002<=
So, I think you need to retry your solution. I noticed that you were
lacking a slash between the second digit element and third, so I
corrected. Running this script:
my @now = (localtime)[3 .. 5];
my $date = sprintf('%02d/%02d/%0d2', ++$now[2], $now[1], $now[3] %
100);
print "Date=>$date<=\n";
The output was:
Date=>101/10/02<=
So, I tried a little check:
my @now = (localtime)[3 .. 5];
print "now[1]=$now[1] now[2]=$now[2] now[3]=$now[3]\n";
print "now[0]=$now[0]\n";
print "Date=>$now[0]/$now[1]/$now[2]<=\n";
and got:
now[1]=10 now[2]=101 now[3]=
now[0]=15
Date=>15/10/101<=
Maybe you forgot to refer to the zero element of @now? This caused you
to incriment the year ($now[2]), miss $now[0] and fail to incriment
$now[1]. What you wanted was something like:
my @now = (localtime)[3 .. 5];
my $date = sprintf('%02d/%02d/%0d2', ++$now[1], $now[0], $now[2] %
100);
print "Date=>$date<=\n";
But this returns:
Date=>11/15/02<=
The "02" is a little odd (the original output was 101) as the modulus
on $now[2] seems to have rounded up (1.01 rounded would be 2).
I'm sure the quick reply I gave earlier may also have a bug in it
since I couldn't test it under the environment I have available to me
at home.
>I've benchmarked similar solutions, comparing localtime with Date::Manip and
>have found the localtime solution to be up to 30 times faster.
I received a private email with a similar assertion, but I would like
to see benchmark data. Since my personal web host provider lacks
Date::Manip I will have to do this at work. I will run the command I
mentioned earlier in this thread 1 million times and tally the time. I
will also do the same with your script and tally that time. I am
curious to see the duration of both since I'm not sure of the timing.
I promise to return valid numbers without any pregnant chads.
But, if you're only going to do this once, why worry about jiffies?
After all, how many times are you going to want to know what the
month/day/year stamp for "today" is.
>hth,
>Dave...
Ben Wilson (a.k.a. Ameen, Last of the Dausha)
____________________________
-"Ever heard of Aristotle . . . Plato . . . Socrates?!"
-"Yes."
-"Morons!"
------------------------------
Date: Thu, 16 Nov 2000 03:42:09 GMT
From: ameen @ dausha . net (Ameen Dausha)
Subject: Re: Date
Message-Id: <3a1355bf.107481217@news>
On Wed, 15 Nov 2000 08:11:00 -0500, Jeff Pinyan <jeffp@crusoe.net>
spat:
>[posted & mailed]
Thanks for the mailing. :-)
>On Nov 15, ameen@dausha said:
>
>>Yes, buy with localtime don't you need to incriment the month and day?
>>Don't you need to handle the fact that this is Perl Year 100? Granted,
>>that can be handled by adding a few lines of code, but:
>>
>>use Date::Manip;
>>
>>$today = &DateCalc("today", "%m/%d/%y");
>
>Data::Manip is overkill, though. It's everything, and then the kitchen
>sink. It'll slow your program down because it's a behemoth.
Please provide calculated benchmarks. As I state further down in the
thread, I shall endeavor to do so tomorrow and report to this thread
my findings. I don't doubt that turning on a whole package can be a
bit cumbersome, but what is the performance loss compared to the
simplicity of the code? If you note in my follow-up thread, the faster
(and/or easier) solution may not be worth it.
>Why not use a simple localtime() solution -- which would require you to
>KNOW about the return values it provides! -- or use something like the
>POSIX::strftime() function?
I remember reading somewhere ("Perl Cookbook," perhaps?) that POSIX
was bad and so have never used it. But, since you use it because it is
faster than Date::Manip, please provide the benchmark.
I would also love to see how to solve the poster's problem using
POSIX::strftime() function since I have never played with it.
Of course, I have to say that I only recently got turned on to
Date::Manip because I was tired of reinventing the wheel each time I
wrote a script that required me to fondle date and time. What caught
my eye was the ability to gather all the data without having to peek
under the hood. (Then again, I prefer older cars because I like being
able to work on it myself, so my computer mind and reality mind aren't
married to one another.) I still consider myself a bit of a neophyte.
>--
>Jeff "japhy" Pinyan japhy@pobox.com http://www.pobox.com/~japhy/
>PerlMonth - An Online Perl Magazine http://www.perlmonth.com/
>The Perl Archive - Articles, Forums, etc. http://www.perlarchive.com/
>CPAN - #1 Perl Resource (my id: PINYAN) http://search.cpan.org/
Ben Wilson (a.k.a. Ameen, Last of the Dausha)
____________________________
-"Ever heard of Aristotle . . . Plato . . . Socrates?!"
-"Yes."
-"Morons!"
------------------------------
Date: Thu, 16 Nov 2000 05:50:03 GMT
From: garry@zweb.zvolve.net (Garry Williams)
Subject: Re: Duplicate Records
Message-Id: <fAKQ5.645$xb1.39249@eagle.america.net>
On Wed, 15 Nov 2000 18:38:35 GMT, Perry <ts012@my-deja.com> wrote:
>
>foreach $line (<INPUT>) {
> if (index($line, "Message rejected,") >= 0) {
> $reject = (substr($line, 84));
> @rejectedservice = $reject;
> print OUTPUT ("@rejectedservice\n");
Why are you assigning a scalar to an array just to print the array
(which has exactly one element in it)?
> }
>}
>
>The OUTPUT file looks like the following:
>
>service1:1111111
>service2:2222222
>service1:1111111
>service3:3333333
>service3:3333333
>service1:1111111
But I bet it's double spaced if the code above is real.
>And I want it to look like this:
>
>service1:1111111
>service2:2222222
>service3:3333333
Here's a different approach:
my %rejects;
while (my $line = <INPUT>) {
if (index($line, "Message rejected,") >= 0) {
$rejects{substr($line, 84)}++;
}
}
close(INPUT);
...
print OUTPUT keys %rejects;
This simply counts the occurances of the strings substr($line, 84) in
the hash %rejects which you indicate are instances of things like
`service1:1111111'. Since the substr() will include the "\n" on the
end of each line of input, printing the list of them will produce the
output you indicated you desire.
--
Garry Williams
------------------------------
Date: Thu, 16 Nov 2000 06:23:17 GMT
From: garry@zweb.zvolve.net (Garry Williams)
Subject: Re: Duplicate Records
Message-Id: <p3LQ5.648$xb1.39171@eagle.america.net>
On 15 Nov 2000 20:43:13 +0100, Jakob Schmidt <sumus@aut.dk> wrote:
>
>Perry <ts012@my-deja.com> writes:
>
>> list. The problem is that there can be multiple copies of the same
>> string and I only want to output it once. The following is the code
>[...]
>> foreach $line (<INPUT>) {
>> if (index($line, "Message rejected,") >= 0) {
>> $reject = (substr($line, 84));
>> @rejectedservice = $reject;
>> print OUTPUT ("@rejectedservice\n");
>> }
>> }
>
>The obvious way (which must be in the FAQs also) is to use a hash:
>(note! untested snippet!)
>
>my %done = ();
my %done;
>foreach $line ( <INPUT> ) {
> if ( not exists $done{ $line } and
> index( $line, "Message rejected," ) >= 0 ) {
> $done{ $line } = 1;
> $reject = ( substr( $line, 84 ) );
> # @rejectedservice = $reject; # dont know why you did that
> print OUTPUT ( "$reject\n" );
> }
>}
This will not work because the original poster indicates that each
line is possibly unique *except* the end of the line beginning at
offset 84. You need to use the result of the substr() as the hash key
to insure uniqueness.
$done{substr($line, 84)} = 1;
>checking for existence in the hash in stead of trueness of the values
This is a good suggestion.
>to avoid spending too much memory (in case its a huge file)....
But then you read the entire file into memory to process it. This
would be better
while (my $line = <INPUT>) {
instead of the foreach.
The
$reject = ( substr( $line, 84 ) );
print OUTPUT ( "$reject\n" );
will result in blank lines since substr( $line, 84 ) has the
"\n" in it already. Just do
print OUTPUT substr($line, 84);
instead.
The only other comment I have is that the conditions in the if
statement should be reversed in their order. No need to check for the
hash entry, if the input line is of no interest.
To summarize:
while (my $line = <INPUT>) {
my %done;
if ( index($line, "Message rejected,") >= 0
and not exists $done{substr($line, 84)} ) {
$done{substr($line, 84)} = 1;
print OUTPUT substr($line, 84);
}
}
Your solution is shorter than the one I posted.
--
Garry Williams
------------------------------
Date: Thu, 16 Nov 2000 07:24:30 GMT
From: garry@ifr.zvolve.net (Garry Williams)
Subject: Re: Exporting variables from modules
Message-Id: <OYLQ5.649$xb1.39488@eagle.america.net>
On Wed, 15 Nov 2000 19:56:31 -0000, Kingsley Tart <a@b.c> wrote:
>I want to have a module that not only contains some common
>subroutines to a suite of scripts that I'm writing, but also declares
>(and assigns values to) a number of variables.
>
>To get round compile errors, I've had to list all of the vars I'm
>exporting in the @EXPORT array and tell the main program to import
>each and every one.
Nope. If you include them in @EXPORT, they will be *unconditionally*
imported into a use'ing package. From the Exporter manual page:
How to Export
The arrays `@EXPORT' and `@EXPORT_OK' in a module hold lists
of symbols that are going to be exported into the users name
space by default, or which they can request to be exported,
respectively.
[snip]
>On top of that, though I'm setting the values, they are not coming
>across from the module to the program, despite having an
>"InitialiseVariables" subroutine to the module and a call to it from
>the main program.
[snip]
Hard to tell what your problem is here since you don't show the code.
Just assign values to the exported variables at the file level in the
use'd module instead of in a subroutine. The assignments will happen
at compile time, so the use'ing module will access initalized
variables.
Constants are more commonly done as subroutines or as use constant
statements instead of explicit assignments to package variables but
the export/import rules are the same:
File main:
#!/usr/local/bin/perl -w
package main;
use strict;
use SkyMail;
print WORKDIR, " and $ANOTHER_DIR\n";
File SkyMail,pm:
package SkyMail;
use strict;
our (@ISA @EXPORT);
use Exporter;
@ISA = qw(Exporter);
@EXPORT = qw( WORKDIR $ANOTHER_DIR);
our ($ANOTHER_DIR) = '/home/joe';
sub WORKDIR { '/tmp'; }
Results:
$ perl main
/tmp and /home/joe
$
--
Garry Williams
------------------------------
Date: Thu, 16 Nov 2000 13:38:48 +1100
From: "Dan" <drinkbeer3@hotmail.com>
Subject: Image Gallery Script
Message-Id: <8uvhbk$dmf$1@seagoon.newcastle.edu.au>
Hi,
I was wondering if anyone knows of a good photo gallery script. I am looking
for one that will create thumbnails automatically and then display them in
an HTML table.
Please email me at drinkbeer3@hotmail.com if you can help.
Thanks in Advance
Dan
------------------------------
Date: Thu, 16 Nov 2000 05:51:02 +0100
From: "Thomas Mager" <Thomas.Mager@nikocity.de>
Subject: Re: Image Gallery Script
Message-Id: <8uvp4n$s3d$01$1@news.t-online.com>
> I was wondering if anyone knows of a good photo gallery script. I am
looking
> for one that will create thumbnails automatically and then display them in
> an HTML table.
I have made a gallery-script at www.art-emilio.de, but I only resized the
pictures with HTML.
The GD-module will help you.
Thomas
--
www.art-emilio.de - Kunstgalerie im Internet
------------------------------
Date: Thu, 16 Nov 2000 04:54:21 GMT
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: IP geography
Message-Id: <slrn916q32.425.mgjv@verbruggen.comdyn.com.au>
On Thu, 16 Nov 2000 10:30:05 +1100,
jason <elephant@squirrelgroup.com> wrote:
> Martien Verbruggen wrote ..
>>On Tue, 14 Nov 2000 14:46:39 +1100,
>> jason <elephant@squirrelgroup.com> wrote:
>
><OT>
>
>>> IP addresses can quite easily be classified by country of designation
>>
>>No, they cannot. There are a few IP addresses that have spatial meaning.
>
> as I'm sure you probably know .. you can very easily determine whether
> an IP address was designated by ARIN or APNIC or RIPE .. and each of the
> non US registries contain country information in the number record ..
> making it "quite easy" to classify IP address by country of designation
Ah, that's what you mean. Ok, in that case, I've got no problems with
your statement. Not much, anyway ;)
Martien
--
Martien Verbruggen |
Interactive Media Division | That's not a lie, it's a
Commercial Dynamics Pty. Ltd. | terminological inexactitude.
NSW, Australia |
------------------------------
Date: Thu, 16 Nov 2000 16:48:15 +1100
From: bigiain@mightymedia.com.au (Iain Chalmers)
Subject: Re: IP geography
Message-Id: <bigiain-1611001648150001@bigman.mighty.com.au>
In article <slrn916q32.425.mgjv@verbruggen.comdyn.com.au>,
mgjv@tradingpost.com.au wrote:
>On Thu, 16 Nov 2000 10:30:05 +1100,
> jason <elephant@squirrelgroup.com> wrote:
>> Martien Verbruggen wrote ..
>>>On Tue, 14 Nov 2000 14:46:39 +1100,
>>> jason <elephant@squirrelgroup.com> wrote:
>>
>><OT>
>>
>>>> IP addresses can quite easily be classified by country of designation
>>>
>>>No, they cannot. There are a few IP addresses that have spatial meaning.
>>
>> as I'm sure you probably know .. you can very easily determine whether
>> an IP address was designated by ARIN or APNIC or RIPE .. and each of the
>> non US registries contain country information in the number record ..
>> making it "quite easy" to classify IP address by country of designation
>
>Ah, that's what you mean. Ok, in that case, I've got no problems with
>your statement. Not much, anyway ;)
How 'bout...
#!/usr/bin/perl -w
use strict;
use Net::Ping;
use ICBM::Launch;
my $host='209.204.241.44';
my $p = Net::Ping->new();
my $m = ICBM::Launch->new('megatonnage'=>0.5);
my ($lat,$lon);
die "Cant find host" unless $p->ping($host);
while($p->ping($host)){
$lat=int(rand(36000)-18000)/100;
$lon=int(rand(18000)-9000)/100;
$m->launch($lat,$lon);
}
$p->close();
print "Host $host was probably near $lat,$lon";
------------------------------
Date: Thu, 16 Nov 2000 13:06:05 +0930
From: "Wyzelli" <wyzelli@yahoo.com>
Subject: Re: Line Editing
Message-Id: <AxIQ5.5$241.704@vic.nntp.telstra.net>
<vignolap@my-deja.com> wrote in message
news:8uup2i$n1t$1@nnrp1.deja.com...
> Let me try again and be more articulate/specific:
>
> Start with a line like this:
>
>
Mailbox,name,/o=organization/ou=unit/cn=Recipients/cn=Employees/cn=NAME,
> ,CHIMSG1
>
> Find the name (NAME) and destination server yyyMSGz
>
> Build new line:
> NAME: NAME@yyyMSG2.xxx.COM
>
This make slots of nasty assumptions about your data:
while (<DATA>){
if (/.*cn=(\w+),,(\w+)/i){
my ($name, $server) = ($1,$2);
print "$name:\t\t$name\@$server.xxx.COM\n"; #modify to suit
spaces/tabs
}
}
__END__
Mailbox,name,/o=organization/ou=unit/cn=Recipients/cn=Employees/cn=NAME,
,CHIMSG1
Mailbox,name,/o=organization/ou=unit/cn=Recipients/cn=Employees/cn=PETER
,,CHIMSG1
Mailbox,name,/o=organization/ou=unit/cn=Recipients/cn=Employees/cn=JOHN,
,CHIMSG1
Mailbox,name,/o=organization/ou=unit/cn=Recipients/cn=Employees/cn=FRED,
,PHIMSG2
Mailbox,name,/o=organization/ou=unit/cn=Recipients/cn=Employees/cn=DEBOR
AH,,DARMSG1
Wyzelli
--
($a,$b,$w,$t)=(' bottle',' of beer',' on the wall','Take one down, pass
it around');
for(reverse(1..100)){$s=($_!=1)?'s':'';$c.="$_$a$s$b$w\n$_$a$s$b\n$t\n";
$_--;$s=($_!=1)?'s':'';$c.="$_$a$s$b$w\n\n";}print"$c*hic*";
------------------------------
Date: Wed, 15 Nov 2000 21:28:12 -0600
From: "Randy Kobes" <randy@theory.uwinnipeg.ca>
Subject: Re: Mail::Tools from activestate doesnt work on win32 ?
Message-Id: <8uvkhk$ng8$1@canopus.cc.umanitoba.ca>
<dtbaker_dejanews@my-deja.com> wrote in message
news:8uurco$p8o$1@nnrp1.deja.com...
> I am experimenting with different Mail modules, and would like to use
> one that would allow portable code... developed on my windows 98 machine
> at home, and running on a remote domain host under LINUX.
>
> Apparently, the only module supported by the activestate ppm install is
> the MailTools module, which contains the Mail::Send and other modules.
> I wrote a quick test following the docs, and it does not run... looks
> like it is looking for a mail program to actually send mail which is
> UNIX-only?
[ ... ]
You probably need to send it via an SMTP host on your Windows
machine. Take a look at
http://www.savage.net.au/Perl-tutorials.html#tut-2
and Winfaq4 from ActiveState's docs at
http://velocity.activestate.com/docs/ActivePerl/faq/Windows/
for ways to send mail on Win32.
best regards,
randy kobes
------------------------------
Date: Thu, 16 Nov 2000 04:53:49 GMT
From: dtbaker_dejanews@my-deja.com
Subject: Re: Mail::Tools from activestate doesnt work on win32 ?
Message-Id: <8uvp8s$ibt$1@nnrp1.deja.com>
In article <3A131030.D25CDE59@patriot.net>,
H C <carvdawg@patriot.net> wrote:
> have you tried Net::SMTP under ActivePerl? It's part of the libnet
package
> and so far it works just fine...
-----------------
hhmmm, this may work for me. I am wondering why the docs dont show up in
my local activestate for this module... It seems to be installed, but it
doesnt show in the docs. ah well.
The example seems simple enough, and I will go test right now. However,
it leaves me wondering:
- why are there so many different modules to send Email? I am wondering
if one is "best" for any particular reason?
- I am wondering if Net::SMTP is capable of sending attachemnts? The one
example I found for attachments was using Mail::Sendmail and it looked
pretty involved to create the multipart message!
Dan
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 16 Nov 2000 05:55:45 GMT
From: dtbaker_dejanews@my-deja.com
Subject: Re: Mail::Tools from activestate doesnt work on win32 ?
Message-Id: <8uvst0$l04$1@nnrp1.deja.com>
In article <3A131030.D25CDE59@patriot.net>,
H C <carvdawg@patriot.net> wrote:
> have you tried Net::SMTP under ActivePerl? It's part of the libnet
package
> and so far it works just fine...
>
---------------
ok, I tried it out... It does send mail, but I get a warning message
"bad command or filename" every time I run it right after the
constructor. It still sends the mail though. if I start with this:
#!/usr/bin/perl -w
use Net::SMTP;
$smtp = Net::SMTP->new( 'mail' ); # connect to an SMTP server
... the error msgs pops out here, and I think that 'mail' is correct
because I am on a cable modem at home, and my email SMTP is set to
'mail'.
Other issues are that:
- it seems to take a long time to send the message
- I didnt see any docs on if it can send attachments, or BCC recipients
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 16 Nov 2000 15:19:57 +0900
From: "Kawai,Takanori" <GCD00051@nifty.ne.jp>
Subject: Re: Mail::Tools from activestate doesnt work on win32 ?
Message-Id: <8uvur3$abo$1@nw032.infoweb.ne.jp>
Hi.
<dtbaker_dejanews@my-deja.com> wrote in message
news:8uvp8s$ibt$1@nnrp1.deja.com...
> In article <3A131030.D25CDE59@patriot.net>,
> H C <carvdawg@patriot.net> wrote:
> > have you tried Net::SMTP under ActivePerl? It's part of the libnet
> package
> > and so far it works just fine...
> -----------------
>
> hhmmm, this may work for me. I am wondering why the docs dont show up in
> my local activestate for this module... It seems to be installed, but it
> doesnt show in the docs. ah well.
>
> The example seems simple enough, and I will go test right now. However,
> it leaves me wondering:
>
> - why are there so many different modules to send Email? I am wondering
> if one is "best" for any particular reason?
From How do I send email from ActivePerl?
(in Widndows Specifics, ActivePerl FAQ)
<quote>
If you need to send email from a Perl script, there is no need to use
an external program like sendmail
</quote>
But perlfa9 recommends to use a mail transport agent like sendmail.
<quote>
There are many reasons to use a mail transport agent like sendmail.
These include queueing, MX records, and security.
</quote>
So, I'm using Net::SMTP on Windows, and will use sendmail on UNIX.
> - I am wondering if Net::SMTP is capable of sending attachemnts? The one
> example I found for attachments was using Mail::Sendmail and it looked
> pretty involved to create the multipart message!
Well, Net::SMTP is just for communication.
But you can use MIME::Entity included in MIME-tools for building
multipart messages.
#My homepage may be a help for you if you can read Japanese.
==============================================
Kawai, Takanori(Hippo2000)
Mail: GCD00051@nifty.ne.jp
http://member.nifty.ne.jp/hippo2000
==============================================
------------------------------
Date: Thu, 16 Nov 2000 06:30:14 GMT
From: descacsoft@my-deja.com
Subject: Re: Malformed header resulting from use of mkdir()
Message-Id: <8uvutn$mcc$1@nnrp1.deja.com>
Ed:
Generally, I find that people who feel the need to put others down
usually lack self-confidence and self-esteem.
I also noticed that old Drew didn't offer any solutions inside all the
rude and condescending insults. Ah, well, his responses tell all, don't
they?
In article <wtXJ5.26178$rD3.1781464@newsread2.prod.itd.earthlink.net>,
"Ed Grosvenor" <secursrver@hotmail.com> wrote:
> To those of you who were helpful, I want to say thank you. To those
of you
> who were simply rude and condescending, all I can say is that I hope
that
> someone shows you the same courtesy some day when you run accross
your next
> pedestrian stumbling block. Of course, good programmers understand
that
> sometimes when the pressure is on and the hours are long, it's the
obvious
> answer that escapes us. I just hope that those of you who find it
more
> fulfilling to criticize someone for asking a question than to play a
> meaningful part in a mutulally beneficial discussion with other
programmers
> never have "one of those days." Again, thank you to those who were so
> helpful.
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 16 Nov 2000 11:43:11 +0930
From: "Wyzelli" <wyzelli@yahoo.com>
Subject: Re: No idea about perl, Long post, short question
Message-Id: <TjHQ5.1$241.427@vic.nntp.telstra.net>
"Simon Watkins" <siwatkins@iee.org> wrote in message
news:DxGQ5.2113$B02.45523@news6-win.server.ntlworld.com...
<snip>
> if ($sAction eq "SHOWCART") # display the shopping cart - this
is a
> {
> @Response = ShowCart();
This sets the array @Response by calling the subroutine ShowCart
> ($Status, $Message, $sHTML, $sCartID) = @Response; # parse the
response
If as you seem to believe, the $sHTML varaible contains the incorrect
value, the it is being set by the ShowCart subroutine
> if ($Status != $::SUCCESS)
> {
> ACTINIC::ReportError($Message, ACTINIC::GetPath());
> exit;
> }
> PrintPage($sHTML, $sCartID);
> ******************************************************
See above.
You may need to include the ShowCart subroutine to determine where the
change needs to be made.
Wyzelli
--
($a,$b,$w,$t)=(' bottle',' of beer',' on the wall','Take one down, pass
it around');
for(reverse(1..100)){$s=($_!=1)?'s':'';$c.="$_$a$s$b$w\n$_$a$s$b\n$t\n";
$_--;$s=($_!=1)?'s':'';$c.="$_$a$s$b$w\n\n";}print"$c*hic*";
------------------------------
Date: Thu, 16 Nov 2000 05:16:09 GMT
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: No idea about perl, Long post, short question
Message-Id: <slrn916rbu.425.mgjv@verbruggen.comdyn.com.au>
On Thu, 16 Nov 2000 00:22:10 -0000,
Simon Watkins <siwatkins@iee.org> wrote:
> "Randal L. Schwartz" <merlyn@stonehenge.com> wrote in message
> news:m1r94cones.fsf@halfdome.holdit.com...
>> >>>>> "Simon" == Simon Watkins <siwatkins@iee.org> writes:
>>
>> Simon> Thank you for your reply. I can only hope that given your
>> Simon> response, that others more gracious will be still be kind
>> Simon> enough to assist.
>>
>> Well, for those keeping score at home, we now have:
>
> It is good to see a professional technical consultant being so helpful. I'm
> sure you gain lots of commercial work this way.
You'd probably be surprised.
>> - upside down quoter (usually a good clue)
>
> Ahh, the NG police.
Nope. Just someone who's figured out the statistical relation between
top posting and cluelessness. Just like many people here have.
>> and something you can't know unless I tell you:
>>
>> - commits usenet error of *** stealth CC *** (on this post)
>
> You really do need to get a life. Your CC to me arrived prior to your NG.
> Someone as "Professional" as you, ought to know that NG posts take a while
> to propagate. If you check the timestamps you'll see the email was sent to
> you WITH IDENTICAL text, as a courtesy (in the same way as you emailed me)
> prior to my being even able to reply on the newsgroup. Professional!?
The key in that sentence was 'stealth'. Nowhere in your message did
you _state_ that you sent an email copy as well as a post to the
newsgroup. Especially since mail normally propagates faster than
Usenet feeds, that is very annoying. It means that someone would most
likely reply to the email, while the response really belongs in the
group. And that means that they'll need to do extra work to get it in
the group as well, when later they discover that that's where it
should have gone.
Common sense. Common rule.
>> For those of you with an itchy plonk finger, I hope that's enough.
Indeed. And if it wasn't, this probably is.
Martien
--
Martien Verbruggen |
Interactive Media Division | Never hire a poor lawyer. Never buy
Commercial Dynamics Pty. Ltd. | from a rich salesperson.
NSW, Australia |
------------------------------
Date: Thu, 16 Nov 2000 06:44:14 -0000
From: "Simon Watkins" <siwatkins@iee.org>
Subject: Re: No idea about perl, Long post, short question
Message-Id: <XkLQ5.2509$X03.41576@news2-win.server.ntlworld.com>
"Martien Verbruggen" <mgjv@tradingpost.com.au> wrote in message
news:slrn916rbu.425.mgjv@verbruggen.comdyn.com.au...
> On Thu, 16 Nov 2000 00:22:10 -0000,
> Nope. Just someone who's figured out the statistical relation between
> top posting and cluelessness. Just like many people here have.
Martien,
Thank you for your contribution to this thread. As I mentioned in a follow
up to Jon Ericson, which I can only assume you must have somehow missed, or
weren't able to read as it was posted some 4 hours prior to your response,
perhaps all this is a little pointless and fruitless. I have more
important things to do than debate whether or not top posting represents
"cluelessness".
> The key in that sentence was 'stealth'. Nowhere in your message did
> you _state_ that you sent an email copy as well as a post to the
> newsgroup. Especially since mail normally propagates faster than
> Usenet feeds, that is very annoying.
I explained my reasons. There was no "stealth" involved. This really is a
petty issue, and I suggest that if you wish to continue to debate it, please
take it to email.
Simon Watkins
------------------------------
Date: Thu, 16 Nov 2000 03:59:06 GMT
From: dtbaker_dejanews@my-deja.com
Subject: Re: Prevent web page time out during CGI execution?
Message-Id: <8uvm28$fn8$1@nnrp1.deja.com>
In article <8uv6fh$666$1@doughboy.cs.utexas.edu>,
logan@cs.utexas.edu (Logan Shaw) wrote:
> In article <8uv4s1$1oe$1@nnrp1.deja.com>, <stimpiton@my-deja.com>
wrote:
> >Is there a way to prevent a web page from timeing out during a CGI
> >execution?
------------
you really should try posting on a more cgi oriented group like
comp.infosystems.www.authoring.cgi but since this DOES make good use of
the perl system() call, I think it is good to put here too.
it is possible... basically you call a perl script which is a "wrapper"
around your "real" script. The wrapper does nothing more than
- get the available variables from CGI
- print out a quick response to the client to prevent timeout
- fire up the "real" script in another process using the system() call
and pass in the CGI vars as arguments
the only really tricky part is trying to decide how you are going to get
your results to the browser. I usually have the wrapper create a
temporary progress file that refreshes to itself every second. And then
have the real process write its final results to that same file when
done so it gets caught on the next refresh. kind of weird but it works.
one way to start a separate perl process would be to do something like
this from your wrapper:
# forking a new process to do the work so browser doesnt have to wait
my $SysCmd = "perl RealScript.pl $SkipSizing $RedirectTo @ImageList " ;
if ( $^O =~ m/mswin32/i ) {
system( "start -m $SysCmd" ) ;
} else {
system( "$SysCmd" ) ;
}
hope that give you some ideas....
Dan
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
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 V9 Issue 4899
**************************************