[16046] in Perl-Users-Digest
Perl-Users Digest, Issue: 3458 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jun 22 21:05:27 2000
Date: Thu, 22 Jun 2000 18:05:14 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <961722314-v9-i3458@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Thu, 22 Jun 2000 Volume: 9 Number: 3458
Today's topics:
Re: [ Regexp ] Curious Behaviour of " last if /(match)/ (Tad McClellan)
Re: [ String ] How to divide a string into equal string <thoren@southern-division.com>
Re: [ String ] How to divide a string into equal string <lauren_smith13@hotmail.com>
Re: And now, The Forehead Smack... <sumus@aut.dk>
Re: Creating a cause from information. <sumus@aut.dk>
Date time comparisons? <jrn@borgcollective.org>
Date::Manip can't handle Arizona Time zone? bduellnca@my-deja.com
Re: defined() <sumus@aut.dk>
Re: defined() (Malcolm Dew-Jones)
eof for sendmail .. <csorensen@uptimeresources.net>
Hash keys <lkulkarn@cisco.com>
Re: Hash keys (Brandon Metcalf)
Re: How can I get perl (cgi) html to work on the OS Sea <rootbeer@redcat.com>
Re: how do I "redirect" a substitution? <gellyfish@gellyfish.com>
Re: How to find perl/tk useful modules? Example: proces <rootbeer@redcat.com>
how to reset open file limit from perl on UNIX? <jander@ml.com>
Re: https <gellyfish@gellyfish.com>
Re: IDE for perl? felrodian@my-deja.com
Re: Its Late... Im really Tired... <sumus@aut.dk>
Re: lists and eliminating dupes <billy@arnis-bsl.com>
Re: NT or Unix at runtime <lwaibel@cwia.com>
One Way ANOVA <cghansen@micron.com>
Re: Passing a database handles to subs.... <david@dbillingham.demon.co.uk>
Re: Perl Builder 2.0 for LINUX - Beta Available (Mark W. Schumann)
Problem with Perl/ISAPI <notonyourlife@noway.com>
Re: Proper Shopping Cart design.... <rootbeer@redcat.com>
Re: simple array question <ils@gil.com.au>
Re: simple array question <rootbeer@redcat.com>
some question about module when I use perl ! <rafael_cn@my-deja.com>
Re: strict and @ISA <abe@ztreet.demon.nl>
Re: sybperl question <kailouKILL@SPAManassara.com>
Re: Sys::Syslog & _PATH_LOG <frog242@hotmail.com>
Re: Urgent help with non-blocking child process require <rootbeer@redcat.com>
use of eval and strict does not correctly set $@ <adamsch1NOadSPAM@yahoo.com.invalid>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 21 Jun 2000 11:01:16 GMT
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: [ Regexp ] Curious Behaviour of " last if /(match)/ "
Message-Id: <SLRN8L183S.UK.TADMC@MAXIM.METRONET.COM>
On 21 Jun 2000 08:29:45 +0100, Jonathan Stowe <gellyfish@gellyfish.com> wrote:
>On Tue, 20 Jun 2000 03:26:57 +0200 TheEx0rcist wrote:
>>> Use my(). Don't use local().
>>
>> The problem with my() is that you get warning messages with perl -w when you
>> use it inside loops ("my" variable masks earlier declaration in same scope).
>>
>> For instance the following code produces the error message ::
>> --
>> my $a;
>> while(1) {
>> my $a = ...
>> }
>>
>
>No it doesnt. The first 'my $a' is not in the same scope as the second.
And using local() to avoid a warning message is like turning
up the volume on the radio to "fix" the funny sound that
your car is making.
It does not "fix" anything. The car is still broken, you just
can't tell that it is still broken.
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Tue, 20 Jun 2000 22:01:44 GMT
From: "Thoren Johne" <thoren@southern-division.com>
Subject: Re: [ String ] How to divide a string into equal string
Message-Id: <8IOPLM$5MU$18$1@NEWS.T-ONLINE.COM>
TheEx0rcist <TheEx0rcist@fanclub.org> wrote in message
news:8iop7e$1bjp$1@news4.isdnet.net...
> That Simple ?
> Damn you are great !!
> Thank you !!
even i have lucid moments... sometimes ;)
gruß
thoren
8#X
--
----------------------------------------------------------------------
Thoren Johne - 8#X - thoren@southern-division.com
Southern Division Classic Bikes - www.southern-division.com
------------------------------
Date: Wed, 21 Jun 2000 00:59:10 GMT
From: "Lauren Smith" <lauren_smith13@hotmail.com>
Subject: Re: [ String ] How to divide a string into equal string
Message-Id: <8IP404$3FE$1@BROKAW.WA.COM>
Tina Mueller <tina@streetmail.com> wrote in message
news:8ip2md$5a8pr$2@fu-berlin.de...
>
> Lauren Smith <lauren_smith13@hotmail.com> wrote:
>
> > Lauren (who also notes that the American alphabet has 26 letters, not 25
:-)
>
> this is a miracle.
> how to divide a string with 24 letters (alphabet without k,l)
> into 25 letters (alphabet without x)?
> i can't find a way...
John 5:3-14
Could the missing 'x' really be a signal? Compound that with the OP's ID
(Exorcist)...
Worrisome for an atheist like me... ;-)
Lauren
------------------------------
Date: 23 Jun 2000 01:58:53 +0200
From: Jakob Schmidt <sumus@aut.dk>
Subject: Re: And now, The Forehead Smack...
Message-Id: <4s6ls1xe.fsf@macforce.sumus.dk>
mbadolato@cybernox.com (Mark Badolato) writes:
> "He was the first one to create and release modifications and
> enhancements on Perl scripts."
>
> Wow. Apparently I'm a pioneer. Just out of curiosity, what the hell
> were you guys doing between 1987 and 1996? Just leaving scripts as-is,
> or writing completely new ones?? Sheesh.... =8-)
Hey nowadays it seems obvious but before you invented the "reuse by
modification" paradigm in 1996 there was really no way for us to know
that it was possible. Just think how hard it was for people to imagine
electro magnetism before Ørsted did it for them. Now we take generators
and electric shavers etc. for granted. Well the didn't before Ørsted.
We're all very grateful. You bet.
--
Jakob
------------------------------
Date: 23 Jun 2000 01:50:19 +0200
From: Jakob Schmidt <sumus@aut.dk>
Subject: Re: Creating a cause from information.
Message-Id: <66r1s2bo.fsf@macforce.sumus.dk>
malverian@my-deja.com writes:
> I was unaware of that.. could you explain how I would do this with $_?
> Is <SOCK> constantly written into $_ while it is open?
No, it reads a record (typically a line) off the socket and returns the
contents. When you use it in while ( <SOCK> ) however the contents
are assigned to $_. Inside the block you'll need to go $_ = <SOCK>
if you want to get the next record.
Using $_ for your records also makes regex tests much nicer since they
use $_ as default data, so you'll go /blah/ in stead of $data =~ /blah/
--
Jakob
------------------------------
Date: Wed, 21 Jun 2000 01:27:24 GMT
From: "jrn" <jrn@borgcollective.org>
Subject: Date time comparisons?
Message-Id: <SL06F9B4E7F75@CORP.SUPERNEWS.COM>
Hello all:
I am writing a Perl script that needs to compare file access times
to a given date to determine if the file is old enough to be deleted.
What facilities does Perl provide (or a module) that allows one to
compare date times? I am using the ctime() function to print times.
But I don't see a difftime() type function anywhere...
Anybody got some ideas for me?
Thanks,
jrn@borgcollective.org
------------------------------
Date: Thu, 22 Jun 2000 23:19:30 GMT
From: bduellnca@my-deja.com
Subject: Date::Manip can't handle Arizona Time zone?
Message-Id: <8iu6tk$te8$1@nnrp1.deja.com>
I ran into this problem. Look in your Manip.pm file for $Cnf{"TZ"} and
make it $Cnf{"TZ"}='MST7';
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 23 Jun 2000 01:26:29 +0200
From: Jakob Schmidt <sumus@aut.dk>
Subject: Re: defined()
Message-Id: <8zvxs3fe.fsf@macforce.sumus.dk>
"Brendon Caligari" <bcaligari@shipreg.com> writes:
> what's the use of writing:
> while (defined($strIn = <STDIN>)) {
> instead?
One reason I can think of is the case where $/ is set to something that
evaluates to false in a test. Like '0'. If you have several zeros in a
row in the input file then while( $strIn = <STDIN> ) would stop, while
while (defined($strIn = <STDIN>)) would continue.
I must admit it's a bit far fetched, but it's what i could come up with.
Using defined() in tests is a genral technique for avoiding the problems
arising from the fact that 0, '0' and '' evaluate to false.
--
Jakob
------------------------------
Date: 22 Jun 2000 17:09:23 -0800
From: yf110@vtn1.victoria.tc.ca (Malcolm Dew-Jones)
Subject: Re: defined()
Message-Id: <3952aab3@news.victoria.tc.ca>
Tim (SPAM+indigo@dimensional.com) wrote:
: bcaligari@shipreg.com (Brendon Caligari) wrote in <8iti8b$cln$2@news.news-
: service.com>:
: >what's the purpose of the defined() function?
: >
: > my(
: > $strIn,
: > );
: >
: > while ($strIn = <STDIN>) {
: > print("Read: $strIn");
: > }
: >
: > exit(0);
: >
: >what's the use of writing:
: > while (defined($strIn = <STDIN>)) {
: >instead?
: In your example, defined is superfluous, because all values will have
: a newline, and both '\n' and '0\n' are true. So the only time the
No, if the file has no final \n then the last line will not have a \n.
Then the last line could be the single character '0' which is false.
------------------------------
Date: 22 Jun 2000 20:22:12 EDT
From: Chris Sorensen <csorensen@uptimeresources.net>
Subject: eof for sendmail ..
Message-Id: <3952ADA8.DA01221C@uptimeresources.net>
here's a little script (which works fine) that sends an email via
sendmail to every email address in a file.
I had to place the open and close commands for sendmail inside the
foreach loop since I don't know the command to send email with sendmail.
would someone please tell me the EOF command for sendmail ?
#!/usr/bin/perl
# use sendmail
$sendmail = "/usr/lib/sendmail -t";
# open list of email addresses
open ADDRESS, "address.txt" or die "can't open file: $!";
# read list into array
@mail_to = <ADDRESS>;
# read in email message
open BODY, "message.txt" or die "can't open file: $!";
# assign the message to a variable
$content = <BODY>;
# iterate thru the email list and send each address a message
foreach (@mail_to) {
open(SENDMAIL, "|$sendmail") or die "Cannot open $sendmail: $!";
print SENDMAIL "To: $_ \n";
print SENDMAIL "From: csorensen\@uptimeresources.net \n";
print SENDMAIL "Subject: South African tourism survey \n";
print SENDMAIL "Content-type: text/plain \n\n";
print SENDMAIL $content;
close(SENDMAIL);
}
------------------------------
Date: Thu, 22 Jun 2000 15:37:09 -0700
From: Leena <lkulkarn@cisco.com>
Subject: Hash keys
Message-Id: <39529515.E0190DF8@cisco.com>
Hi,
Are the following to lines equivalent? It seems that they are. So, the
question is whether it is bad practice (and if so, why) to use hash keys
without the quotes when the hash key is meant to be a simple string?
Thanks
------------------------------
Date: 22 Jun 2000 23:50:08 GMT
From: bmetcalf@baynetworks.com (Brandon Metcalf)
Subject: Re: Hash keys
Message-Id: <8iu8ng$skm$1@bcrkh13.ca.nortel.com>
lkulkarn@cisco.com writes:
> Are the following to lines equivalent? It seems that they are. So, the
What *two* lines?
> question is whether it is bad practice (and if so, why) to use hash keys
> without the quotes when the hash key is meant to be a simple string?
No.
Brandon
------------------------------
Date: Wed, 21 Jun 2000 01:51:34 GMT
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: How can I get perl (cgi) html to work on the OS Seal ?
Message-Id: <PINE.GSO.4.10.10006201845450.29843-100000@USER2.TELEPORT.COM>
On Tue, 20 Jun 2000, smile773 wrote:
> Seal is a dos (gui) OS but is still in it's infancy. I would like to
> incorporate perl as a problem solving tool. Because of many
> developmental problems with 32 bit pmode I would like to use html for
> input and output.
Are you sure? HTML is difficult for humans to input, and it's not much
better for output. If you want a GUI, I'd much prefer Perl/Tk.
> The person named Drew Simonis need not reply < rude
I find him less than rude, too. :-) But I find your implication (that he
would be rude rather than helpful) to be troublesome. Perhaps you will
consider all of us rude, no matter how helpful we are. Maybe no one should
answer you. Please try to see everyone's replies in the best possible
light.
> If you nice ppl have some information that will help me get
> perl working in a dynamic cgi mode with seal, I am
> looking forward to hearing from you.
If your webserver supports CGI programs, you should read its documentation
to see how to do that. But what's this about CGI programming? You were
talking about something else before, weren't you? Still, if you have
questions about CGI programming, you probably want to search for the docs,
FAQs, and newsgroups about CGI programming, including reading
comp.infosystems.www.authoring.cgi.
Good luck, with whatever you're doing!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 21 Jun 2000 07:18:01 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: how do I "redirect" a substitution?
Message-Id: <8ILSAE$EKV$1@ORPHEUS.GELLYFISH.COM>
On Sun, 18 Jun 2000 03:46:47 +1000 Michael Roper wrote:
>> >While I'm at it a "writeln" equivalent would be nice. How often do we
>> >use:
>> >
>> > print "$scalar\n";
>> >
>> >where
>> > println $scalar;
>> >
>> >would be neat.
>>
>> Set $\ to "\n".
>
> Thats only any good if you're always printing out newline terminated lines!
> Oh for a println!
>
It wasnt you who was ranting about this before was it ;-}
You can localize the assignment to $\ :
{
local $\ = "<somelineterminator>";
print 'whatever';
}
I would suggest going to Deja News with this as it was beaten to death when
it was discussed before - including the pros and cons of creating your
own subroutine for doing it. I dont think I have enough battery power left
to grep for 'println' or 'writeln' right now ...
/J\
--
** This space reserved for venue sponsor for yapc::Europe **
<http://www.yapc.org/Europe/>
------------------------------
Date: Wed, 21 Jun 2000 01:31:10 GMT
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: How to find perl/tk useful modules? Example: process monitor(progress
Message-Id: <PINE.GSO.4.10.10006201830370.29843-100000@USER2.TELEPORT.COM>
On Tue, 20 Jun 2000, CWW wrote:
> Subject: How to find perl/tk useful modules? Example: process
monitor(progress bar)
http://search.cpan.org/
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 21 Jun 2000 08:39:17 GMT
From: Jim Anderson <jander@ml.com>
Subject: how to reset open file limit from perl on UNIX?
Message-Id: <WKBSNU8E5F3.FSF@ML.COM>
I'm getting bitten by the open file limit on UNIX and haven't managed
to figure out how to reset it from within a perl script.
Any help greatly appreciated.
(Please e-mail me directly, since workload precludes me monitoring
this group.)
Thanks very much,
jim
--
Jim Anderson jander@ml.com
(212) 236-0681
------------------------------
Date: Wed, 21 Jun 2000 07:05:12 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: https
Message-Id: <8IJ82M$QNJ$1@ORPHEUS.GELLYFISH.COM>
On Fri, 16 Jun 2000 09:55:03 GMT Eric Mosley wrote:
> How can I download a file using https (notice the s for ssl) from within a
> perl program and save it to a local file.
>
> Any pointers to modules, etc, would be appreciated greatly!
>
You can do it with LWP::UserAgent if you have Net::SSL or IO::Socket::SSL
installed.
/J\
--
** This space reserved for venue sponsor for yapc::Europe **
<http://www.yapc.org/Europe/>
------------------------------
Date: Tue, 20 Jun 2000 19:40:58 GMT
From: felrodian@my-deja.com
Subject: Re: IDE for perl?
Message-Id: <8IOHC7$OEC$1@NNRP1.DEJA.COM>
I
> >Can anyone recommend me a good integrated development environment
(i.e.
> >editor+debugger)for perl? I am interested in both commercial and
shereware products.
>
> It's a shame that you're only interested in commercial or shareware
> products, as that stops me from recommending Emacs (or Xemacs) which,
> IMO, is the best editor/debugger for Perl (or most other languages).
> Unfortunately for you, it's neither a commercial product nor
> shareware, but open source (or free) software.
>
> If you get over your requirement to pay for your software then I would
> suggest you check it out at <http://www.gnu.org> or
> <http://www.xemacs.org>.
Nicely put, Dave. I thought the same thing when I saw "shareware".
Nick Finzer,
Defender of Freedom.
In response to the orignal question, if you plan on using a real OS
(Linux) and want to use perl to make graphical programs usint GTK+,
glade is a nice IDE for making the GUI and can work with perl, C, and
others.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 23 Jun 2000 01:39:13 +0200
From: Jakob Schmidt <sumus@aut.dk>
Subject: Re: Its Late... Im really Tired...
Message-Id: <7lbhs2u6.fsf@macforce.sumus.dk>
drew@i4free.co.nz writes:
> How do u parse a form input from a textarea form... so that teh returns
> do no taffect it when u write it to a file..
If what you want are no newlines then just remove them (eg. tr/\n/ /).
Or did I misunderstand?
The more common problem is that people forget that newlines in HTML source
don't become newlines in the browser window. That's easy too: s/\n/<BR>\n/g
--
Jakob
------------------------------
Date: Wed, 21 Jun 2000 01:07:41 GMT
From: Ilja Tabachnik <billy@arnis-bsl.com>
Subject: Re: lists and eliminating dupes
Message-Id: <8IP4GK$6DI$1@NNRP1.DEJA.COM>
In article <GcR35.62353$5k2.130557@dfw-read.news.verio.net>,
"la.news.verio.net" <gregh@numbnut.com> wrote:
> Hello,
>
> This sub takes a list and spits out what's in it. Currently in my
flat text
> file database, there are duplicates. I'd like to eliminate these and
only
> display each entry once, but I'm having some trouble doing this. Any
ideas
> on what th best way to do this is?
>
One of the best ways is to read the FAQ first:
"How can I extract just the unique elements of an array?".
The answer may be found on your local disk by typing
'perldoc perlfaq4' or at
http://www.cpan.org/doc/manual/html/pod/perlfaq4.html.
Hope this helps.
Ilja.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 21 Jun 2000 13:28:27 GMT
From: Larry R. Waibel <lwaibel@cwia.com>
Subject: Re: NT or Unix at runtime
Message-Id: <VA.0000003A.0E57F51E@CWIA.COM>
In article <8io8j8$iq7$1@bcrkh13.ca.nortel.com>, Brandon Metcalf wrote:
> Don't use the Perl distribution that comes with clearcase. It's old and
> incomplete. Install your own.
>
But that would mean that all the client users would have to install Perl as
well and ClearCase. Using what comes with it means the triggers will work
since it's already installed.
------------------------------
Date: Thu, 22 Jun 2000 16:52:30 -0600
From: "Colby Hansen" <cghansen@micron.com>
Subject: One Way ANOVA
Message-Id: <8iu5bg$fhv$1@admin-srv3.micron.com>
I'm looking for a way to calculate one way ANOVA p-vals. CPAN is very
limited as far as statistics modules go. Does anyone know where I might be
able to find an existing module or an algorithm I can use to create my own?
Thanks!
------------------------------
Date: Tue, 20 Jun 2000 23:56:05 GMT
From: "David" <david@dbillingham.demon.co.uk>
Subject: Re: Passing a database handles to subs....
Message-Id: <961548923.3621.0.NNRP-14.C2DEB140@NEWS.DEMON.CO.UK>
----- Original Message -----
From: West, Glenn A <glenn.west@eds.com>
To: <david@dbillingham.demon.co.uk>
Sent: 20 June 2000 17:53
Subject: Re: Passing a database handles to subs....
> There are two ways. Use the reference directly (do_work1) or pass in a
> reference to a reference (do_work2). The latter, of course, requires you
to
> do a dereference in the subroutine. Actually I guess you could come up
with
> an infinite number of ways by passing in references to references.
>
> #!/usr/bin/perl
>
> use DBI;
>
> $dbh=DBI->connect("dbi:Ingres:control_memo");
>
> do_work1($dbh);
>
> do_work2(\$dbh);
>
> $dbh->disconnect;
>
> # Pass in the reference
> sub do_work1
>
> my ($dbh)=$_[0];
>
>
> $sth=$dbh->prepare("SELECT cntrl_memo_nbr FROM t_memo_detail");
>
> $sth->execute();
>
> while ($cntrl_memo_nbr=$sth->fetchrow())
> print "ctrl_memo_nbr\n";
>
> }
>
> $sth->finish();
> }
>
> # Pass in the reference to the reference
> sub do_work2
>
> my ($dbh_ref)=$_[0];
>
>
> $sth=$$dbh_ref->prepare("SELECT cntrl_memo_nbr FROM t_memo_detail");
>
> $sth->execute();
>
> while ($cntrl_memo_nbr=$sth->fetchrow())
> print "$cntrl_memo_nbr\n";
> }
>
> $sth->finish();
> }
>
> The above works the same for statement handles produced by the "prepare"
DBI
> method.
>
> HTH...
Dear Glenn
Thanks for the above - much appreciated. All becomes clear! Not quite sure
why I couldn't get at least version1 myself....
Regards
David
------------------------------
Date: Wed, 21 Jun 2000 23:30:06 GMT
From: catfood@apk.net (Mark W. Schumann)
Subject: Re: Perl Builder 2.0 for LINUX - Beta Available
Message-Id: <8IPDCP$FRJ@JUNIOR.APK.NET>
In article <8ioetu$man$1@nnrp1.deja.com>, <sty2999@my-deja.com> wrote:
>Yes, it requires Wine to run as it is compiled under Windows. However,
>it is specificially designed for Linux -- certainly not just enabling
>the Windows version using Wine.
>
>Perhaps you could help me understand your objection to the use of Wine.
>
>My understanding is that it runs maybe 10% slower than a native Linux
>application. Which does not seem a show stopper to me.
>
>Obviously it has a Windows look and feel...but then so do lots of
>native Linux apps, including for example, the Gnome desktop.
I'm not the original griper, but you're missing the point.
If I'm a Perl programmer who uses Linux, and I want to use your Perl
IDE on Linux, I have to install and configure some completely unrelated
bit of software to do it.
We expect installers and perhaps IDEs to require a shell, the usual
set of scripting tools, and maybe even perl itself. But Linux users
(nor most Unix users) would not assume that having and using Wine is
a normal prerequisite to using a Perl IDE.
Tail wagging dog. Cart before horse. That kind of thing.
And Wine itself is so doggone big and complicated that you've just
about eliminated the possibility that someone might download and
try the demo on a lark.
------------------------------
Date: Fri, 23 Jun 2000 06:22:41 +0800
From: "Paul" <notonyourlife@noway.com>
Subject: Problem with Perl/ISAPI
Message-Id: <395291b6@pink.one.net.au>
Platform: IIS 5 on Windows 2000
Latest version of ActivePerl. (got it down last week)
Using a form2mail CGi that works by sockets. My SMTP server is running qmail
on Linux. The script was pulled from
http://www.liquidsilver.com/scripts/form2mail/
When I run this perl script from the command line or as a CGI in IIS via
perl.exe "%s" "%s" it works fine. When I run it thru ISAPI as PERLIS.DLL it
terminates with a SMTP error.
When I look in the qmail log it is saying that it rejected the mail because
it received a line feed without a carriage return (qmail is picky).
This rejection occurs before any of the SMTP commands "HELO", etc. The
script opens the socket S and connects to the server (both return all ok)
and qmail logs the connection. Then I think qmail closes it with this an
error 256 in its logs because the $a = <S> which should return something
like "Qmail SMTP Server Ready" (or whatever comes up when u telnet to port
25) comes up blank and this is where the script dies. (The next step is to
send the "HELO" string o the socket.
So why would the behaviour be different between PERL.EXE and PERLIS.DLL??
ta
Paul
(reply to group only)
------------------------------
Date: Wed, 21 Jun 2000 01:43:52 GMT
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Proper Shopping Cart design....
Message-Id: <PINE.GSO.4.10.10006201835140.29843-100000@USER2.TELEPORT.COM>
On Tue, 20 Jun 2000 eriks78@my-deja.com wrote:
> i'm looking for opinions from experienced perl developers on the best
> way to architect and plan a shopping cart system.
Use an existing one rather than making your own. But this isn't really a
Perl programming question, is it? The program could be written in nearly
any capable programming language. There aren't any Perl-specific issues
here, are there? It sounds like a question on programming for the web,
which is generally better discussed in comp.infosystems.www.authoring.cgi.
In any case, many folks like minivend.
> 1) text file cart on server.
> cookie on client.
> i see file locking problems possible here.
Well, file locking problems are easy to solve. Still, cookies aren't
supported everywhere, and they identify browsers, rather than customers.
So they're generally not a good choice.
> i'm leaning towards a configuarble system which allows the user to
> select the method they wish to use.
Well, that's one way to do it. If I were starting from scratch, I'd
probably use authentication, myself, since I don't see the need to give
the users a choice there. But if you have questions on authentication, the
folks in c.i.w.a.c know all about it. Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Fri, 23 Jun 2000 08:06:00 +1000
From: "Phil Sutcliffe" <ils@gil.com.au>
Subject: Re: simple array question
Message-Id: <3952976a_1@news.bne.gil.com.au>
"Abe Timmerman" <abe@ztreet.demon.nl> wrote in message
news:9qo3ls8tjvtg5t57nojp6qnk48r77bh5at@4ax.com...
> On Thu, 15 Jun 2000 12:44:34 +1000, "Phil Sutcliffe" <ils@gil.com.au>
> wrote:
>
> You seem to be hard to please :-)
> I think it should be obvious by now why not to use sym-refs.
> You don't want to use a hash and you don't want a loop (although I can't
> think of any reason why).
>
Don't get me wrong. I'm not trying to be difficult. I implemented one
solution a few days ago -it's in place and is working fine.
I'm just trying to learn all the ways of skinning the cat.
Thanks (to you all),
Phil.
------------------------------
Date: Wed, 21 Jun 2000 01:18:13 GMT
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: simple array question
Message-Id: <PINE.GSO.4.10.10006201815170.29843-100000@USER2.TELEPORT.COM>
On Wed, 21 Jun 2000, Phil Sutcliffe wrote:
> "Tad McClellan" <tadmc@metronet.com> wrote in message
> news:slrn8kuu0u.gc2.tadmc@magna.metronet.com...
> >
> > What did I say that is "blatently" unfriendly?
> >
>
> Perhaps I'm over sensitive, but I don't take too kindly to being
> patronised and smart comments like
>
> >You don't wear a seat belt in the car either, do you?
You probably didn't see the smile on Tad's face when he said that. He was
trying to make you chuckle. Try to give him the benefit of the doubt, and
move on. :-)
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Thu, 22 Jun 2000 22:42:07 GMT
From: sunlights <rafael_cn@my-deja.com>
Subject: some question about module when I use perl !
Message-Id: <8iu4nt$rnd$1@nnrp1.deja.com>
My script need a module and the module include 2 .dll file.
When I compled my script by perl2exe and got the .exe file,I sent it to
the server.But it can't execute. Why ?
Error Message:
Can't locate loadable object for module Image::Magick in @INC (@INC
contains: PERL2EXE_STORAGE . lib\site .) at index.cgi line 12
BEGIN failed--compilation aborted at index.cgi line 12.
--
-----------------------------
like perl but need your help !
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 21 Jun 2000 23:24:23 GMT
From: Abe Timmerman <abe@ztreet.demon.nl>
Subject: Re: strict and @ISA
Message-Id: <SIJ2LS83BJOOIOUKJODCVIQLKNAERHPA84@4AX.COM>
On 21 Jun 2000 11:05:21 -0700, Andrew Perrin - Demography
<aperrin@davis.DEMOG.Berkeley.EDU> wrote:
> Quick question: what is the proper way to make strict not complain
> about @ISA requiring a package name? Packages that don't work under
> use strict make me queasy, but @ISA = qw(foo bar) sets off the alarms.
use base qw(Foo Bar);
perldoc base
--
Good luck,
Abe
------------------------------
Date: Thu, 22 Jun 2000 16:03:28 -0700
From: Kailou Anassara <kailouKILL@SPAManassara.com>
Subject: Re: sybperl question
Message-Id: <kailouKILL-7863C2.16032822062000@nntp1.ba.best.com>
In article
<Pine.GSO.4.10.10006221330580.4312-100000@user2.teleport.com>, Tom
Phoenix <rootbeer@redcat.com> wrote:
Sybperl is alive and well. Yes, the trend is to move toward a more
portable DBI/DBD implemntation. The DBI/DBD implementation is immature
in comparison to Sybperl, though.
-Kailou
> On 22 Jun 2000, Jim Anderson wrote:
>
> > sybperl appears to be missing the functionality of DBlib's
> > dbsetmaxprocs. I hope the functionality is really available but
> > hidden.
>
> Unless I'm misinformed, no one should be using sybperl any longer. It's
> really just an offshoot of ancient Perl 4, isn't it? Try this instead:
>
> http://search.cpan.org/search?dist=DBD-Sybase
--
// Da Si Moru Inga Koyo \\
kailouKILL@SPAManassara.com
------------------------------
Date: Fri, 23 Jun 2000 00:10:10 +0200
From: Christian Jaeger <frog242@hotmail.com>
Subject: Re: Sys::Syslog & _PATH_LOG
Message-Id: <39528EC2.64A4431D@hotmail.com>
Just to the record.. I have the same problem with perl 5.6.0 on Digital
Tru64 unix, it's not defined in any header system file.
I'll experiment with defining as '/dev/log' and similar tomorrow/in the
next days.
christian.
------------------------------
Date: Tue, 20 Jun 2000 17:26:31 GMT
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Urgent help with non-blocking child process required
Message-Id: <PINE.GSO.4.10.10006201007520.29843-100000@USER2.TELEPORT.COM>
You've already gotten help on part of this, but there may be another issue
or two....
On Tue, 20 Jun 2000 salim@cygnos.com wrote:
> Newsgroups: comp.lang.perl.misc, comp.lang.perl.modules, comp.lang.perl,
> comp.lang.perl.moderated
If your news administrator still carries comp.lang.perl, please let him
or her know that that newsgroup has not existed since 1995. If you
have such an outdated newsgroup listing, you are probably missing out
on many other valid newsgroups as well. You'll be doing yourself and
many others a favor to use only comp.lang.perl.misc (and other valid
Perl newsgroups) instead.
> Subject: Urgent help with non-blocking child process required
It doesn't help to ask for "urgent" help. Folks who answer questions on
Usenet always do so at top speed, which is the same as minimum speed -
there's no point in answering any faster or slower than what's natural.
Perhaps you're thinking of Usenet as a help desk, and hoping that "urgent"
problems will go to the head of the line. Stop that. Thank you.
> Below is a complete code
> se strict;
Somehow I don't think that's complete. Now, I don't want to come down on
you too hard for a simple typo. But too often people post code which is
different than the code which is giving them trouble. This wastes
everyone's time in finding the wrong problems. Instead of retyping the
code, using copy-and-paste (or something equivalent) will be more
reliable.
> require Exporter;
> require AutoLoader;
When you post problem code to Usenet, you should almost always strip out
the extraneous parts, so as to more clearly show where the problem is. I
don't think that you were doing any exporting or autoloading - in fact,
since those are most often used with modules, and you were showing example
_programs_, I have to wonder what those lines were doing at all. They
certainly look extraneous.
Still, there are other parts of your sample programs which seem to
indicate that you left something out. In general, you shouldn't leave
anything out of your sample code. A good example will be small, but
self-contained. This isn't always easy to accomplish, I admit.
> if (my $pid=open(CHILD, "|-")){
> CHILD->autoflush(1);
> print CHILD $y;
> print "\nSnippetA: iteration $x\n";
> waitpid(-1,&WNOHANG);
> }else{
> exec "perl snippetB.pl";
> }
Using proper indentation, although it makes no difference to perl, will
help human beings to read, write, debug, and maintain the code. A good
programmers' editor will help you. In any case, before posting code to
Usenet, you should ensure that the format properly shows its structure.
You don't seem to be checking for a failed open and instead simply
assuming that, if the return value is false, you're in the child process.
That's not a good idea. Especially when you're creating new processes in a
loop, as you seem to be doing, you should check that that's succeeded.
> print "\nsnippetB: ...sleeping\n";
> sleep 10;
> print "\nsnippetB: ... just woke up\n"
Do you know about output buffering? Have you read about the $| variable in
the perlvar manpage?
Good luck with it!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Thu, 22 Jun 2000 16:16:42 -0700
From: dfdf <adamsch1NOadSPAM@yahoo.com.invalid>
Subject: use of eval and strict does not correctly set $@
Message-Id: <10417584.c85045d9@usw-ex0103-018.remarq.com>
Hi, have an interesting situation here hope that someone can
help.
I'm trying to eval a piece of code that is loaded up from a file.
I want to trap any compile time or runtime errors using $@. The
thing is if the script that I load 'uses' strict, and there is a
strict related error, that error message is printed to STDOUT,
but not set in $@.
Example:
#odd.pl
$foo = 'use strict; $SIG{PIPE} = Plumber';
eval $foo;
print "Error $@ if $@;
If you ran this code, you wil notice that the $SIG{PIPE} =
Plumber; code generates a strict related error of
Bareword "foo" not allowed while "strict subs" in use at (eval
1) line 1.
However it is not set to $@. Any thoughts?
Got questions? Get answers over the phone at Keen.com.
Up to 100 minutes free!
http://www.keen.com
------------------------------
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 3458
**************************************