[15813] in Perl-Users-Digest
Perl-Users Digest, Issue: 3226 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jun 1 03:05:35 2000
Date: Thu, 1 Jun 2000 00:05:10 -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: <959843109-v9-i3226@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Thu, 1 Jun 2000 Volume: 9 Number: 3226
Today's topics:
Re: Activestate Perl - Fork, Threads, and Process jgore@home.com
Re: How do I make perl flush? <philip@my-deja.com>
Re: How do I make perl flush? <philip@my-deja.com>
Re: how do you create scalar vars from a hash? (Arne Hermann)
Re: how do you create scalar vars from a hash? <lr@hpl.hp.com>
Re: if file already exists then remove... <mdkersey@hal-pc.org>
Re: Is Perl for me? (Charles W. Strickland)
Re: Julian Days (John Stanley)
Re: Looking for clever code bumming <lr@hpl.hp.com>
Re: Looking for clever code bumming <jerrad@networkengines.com>
Re: Looking for clever code bumming (Gwyn Judd)
Re: MySQL problem: $DBI::errstr always null jlamport@calarts.edu
Re: oops Re: seeking method to encode email addresses i <bkennedy99@home.com>
Re: oops Re: seeking method to encode email addresses i <nospam@devnull.com>
PERL developer wanted dninfo7454@my-deja.com
Re: PERL JOBS =?iso-8859-1?Q?=28=A340k+=29?= (Mark P.)
perl sites? (Mr MiMiK)
Problem of perl on NT IIS <chpshi@connection.com>
Re: problem with perl garbage collecting (Mark P.)
Re: problem with perl garbage collecting (Ilya Zakharevich)
Re: Problems with Tree::Trie <mdemello@pound.ruf.rice.edu>
Remote .htpasswd editting <paulakis@seas.upenn.edu>
Re: runtime errors - Q how to do this <nospam@devnull.com>
Re: WIN32: cant redir STDOUT to a file (Eric Bohlman)
win32:MAPI Email and CGI - http://here.at/perl <ittso.3wing@videotron.ca>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 01 Jun 2000 04:44:28 GMT
From: jgore@home.com
Subject: Re: Activestate Perl - Fork, Threads, and Process
Message-Id: <3935e873.103438134@24.14.77.5>
On Wed, 31 May 2000 21:55:16 GMT, clintp@geeksalad.org (Clinton A. Pierce) wrote:
>This is right up fork()'s alley. There are limitations to native threads
>under Win32, pardner. It's not just fork(). There are limits under Unix.
>Deal with them, and write some code.
>
>Code it up with fork() -- realize that you can't fork() forever -- and go
>on with life. If you keep flapping yer jaw instead of coding, you won't
>know what you're missing.
I was hoping for something a little more helpfull.
Anyone else?
------------------------------
Date: Thu, 01 Jun 2000 00:59:55 GMT
From: Fearless <philip@my-deja.com>
Subject: Re: How do I make perl flush?
Message-Id: <8h4ci7$2ds$1@nnrp1.deja.com>
In article <sj9brhcu5pj156@corp.supernews.com>,
cberry@cinenet.net (Craig Berry) wrote:
> Tell it something really embarrassing? :)
>
> Seriously speaking, your whole approach seems rather convoluted, but
$|
> might be worth investigating -- see perlvar.
I did say this was my first script. And I've considered several times
already just shitcanning this perl thing and doing the job in C. But
I'm a great believer in horses for courses, and I thought this job
might be a good opportunity to learn perl (and give myself yet another
horse from which to choose in future), so I'm persevering. If you or
anyone else can suggest a better approach for my original problem
(retaining the timestamp of unaltered files), I'm all ears.
I've already played with $| this morning, but no luck so far
(>|<)
|
>
> --
> | Craig Berry - cberry@cinenet.net
> --*-- http://www.cinenet.net/users/cberry/home.html
> | "The road of Excess leads to the Palace
> of Wisdom" - William Blake
>
--
Fearless
(>|<)
|
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 01 Jun 2000 02:01:36 GMT
From: Fearless <philip@my-deja.com>
Subject: Re: How do I make perl flush?
Message-Id: <8h4g5s$4jf$1@nnrp1.deja.com>
In article <8h2rro$pql$1@clematis.singnet.com.sg>,
"Swee Heng" <sweeheng@usa.net> wrote:
> > So, how do I flush the output file (or do whatever) so diff sees a
> > fully written file?
>
> perldoc -q flush
We don't have perldoc, and none of websites I found would accept -q
flush in their search field; some wouldn't even accept select(!).
>
> select((select(FILE_HANDLE), $|=1)[0]);
The following attempts all failed:
$|=1;
while(<>)
..
select((select(FILE_HANDLE), $|=1)[0]);
while(<>)
..
select((select(STDOUT), $|=1)[0]);
while(<>)
..
close(ARGV); #reset $.
close(STDOUT);
close(ARGV); #reset $.
close(main'STDOUT);
(>|<)
|
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 01 Jun 2000 02:28:00 GMT
From: arneh@NOSPAMistar.ca (Arne Hermann)
Subject: Re: how do you create scalar vars from a hash?
Message-Id: <3935beb4.14673748@news.direct.ca>
Larry,
first off, thanks for the help. Just a few answers/comments/questions
to your post:
On Mon, 29 May 2000 17:22:31 -0700, Larry Rosler <lr@hpl.hp.com>
wrote:
>[Followups set to comp.lang.perl.misc. No modules here!]
<*blush*>
>In article <3932c114.62322141@news.direct.ca>, arneh@NOSPAMistar.ca
>says...
>> this is not exactly a module question, but...
>
>You're right, so why mispost it?
Cause I posted it several times elsewhere, without any luck! Sorry,
but sometimes one has to bend the rules (flame shields UP!). Besides,
you were kind enough to answer it here, but no-one did in
comp.lang.perl.misc.
>> I have an associative array (lets say it's %PARMS). I know in advance
>> that there will be certain keys in this hash. What I want to do is
>> assign the values to a scalar variable with the name of the hash key.
>> This is easy in PHP but I can't quite figure out how to do it in Perl.
>>
>> So let's say it looks like:
>>
>> $PARMS{'ParamOne'} = 'FOO';
>> $PARMS{'ParamTwo'} = 'BAR';
>>
>> What can I do (aside from the obvious simple assignment!) to be able
>> to simply access $ParamOne? In this case I have a lot of variables
>> that get passed back and forth between things and I don't want to
>> create a huge simple scalar assignment block... I would like to just
>> iterate over all the keys in $PARMS and create their "scalar
>> equivelent". There's gotta be a 'trick' right?
>>
>> Can anyone tell me how?
>
>Yes, I can tell you how:
>
> $$_ = $PARMS{$_} for keys %PARMS;
Doesn't this imply that one could, in a simpler situation say:
(I'll tackle why I want to do this later herein...)
$$PARMS{'foo'} = $PARMS{'foo'};
?? When I tried this (as a test, not looping over the hash) it didn't
work (hence the original post)! The code was like this:
$PARMS{'foo'} = "FOO";
$$PARMS{'foo'} = $PARMS{'foo'};
print "foo is $foo\n"; #does not print FOO, prints null
$$_ = $PARMS{$_} for keys %PARMS;
print "foo is $foo\n"; #prints FOO
exit;
Given that $_ simply holds the key value over each iteration of the
loop, how is this different?
Oh, and the reason I didn't use the construct you suggested (or even
tried it before) is that the original assignment to $PARMS{} was
already *in* a loop and I was trying to save cycles. I had tried the
$$PARMS{ ... } = $PARMS{ ... }. So, why does it work using $_ and not
in the direct assignment? I'm confused...
>But conscience requires me to ask WHY you want to do this? Generating
>those names uses a technique called Symbolic References, which is very
>poor programming practice, and forbidden if you use the 'strict' pragma,
>as most everyone here recommends.
>
>You have all the variable names safely in a namespace of their own (the
>keys of the hash). What impels you to pollute the global namespace with
>all those new names? Why not just pass around a reference to the hash,
>and dereference it where needed?
>
> $parms = \%PARMS;
> ...
> print $parms->{ParamOne};
>--
>(Just Another Larry) Rosler
The reason is simple. In this situation, I inherited a number of perl
programs that had hard-coded variables in blocks defined at the top
(same across multiple programs). I needed to move these to a config
file (text editable) to avoid changing multiple scripts when a value
had to change and besides, a user had to be able to change the values
and I didn't want them mucking about in the script(s). These
variables were used throughout the code and I really didn't feel like
changing them all to the $PARMS{'variable'} form not to mention
keeping the code readable. Once the variables were set, I was gonna
destroy %PARMS anyway, so the namespace is not really "polluted". It
was just to do something in what I thought was a more elegant way (and
besides, I'm lazy!).
Thanks for the help though. Be interested in hearing if you think
that what I'm doing still really violates the spirit of using the
'strict pragma'. And, of course, your thoughts on why the $$PARMS
assignment doesn't work!
-Arne
------------------------------
Date: Wed, 31 May 2000 22:45:25 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: how do you create scalar vars from a hash?
Message-Id: <MPG.139f984ef5d1bb4a98ab17@nntp.hpl.hp.com>
In article <3935beb4.14673748@news.direct.ca>, arneh@NOSPAMistar.ca
says...
...
> On Mon, 29 May 2000 17:22:31 -0700, Larry Rosler <lr@hpl.hp.com>
> wrote:
...
> >In article <3932c114.62322141@news.direct.ca>, arneh@NOSPAMistar.ca
> >says...
...
> >> I have an associative array (lets say it's %PARMS). I know in advance
> >> that there will be certain keys in this hash. What I want to do is
> >> assign the values to a scalar variable with the name of the hash key.
> >> This is easy in PHP but I can't quite figure out how to do it in Perl.
> >>
> >> So let's say it looks like:
> >>
> >> $PARMS{'ParamOne'} = 'FOO';
> >> $PARMS{'ParamTwo'} = 'BAR';
> >>
> >> What can I do (aside from the obvious simple assignment!) to be able
> >> to simply access $ParamOne? In this case I have a lot of variables
> >> that get passed back and forth between things and I don't want to
> >> create a huge simple scalar assignment block... I would like to just
> >> iterate over all the keys in $PARMS and create their "scalar
> >> equivelent". There's gotta be a 'trick' right?
> >>
> >> Can anyone tell me how?
> >
> >Yes, I can tell you how:
> >
> > $$_ = $PARMS{$_} for keys %PARMS;
>
> Doesn't this imply that one could, in a simpler situation say:
> (I'll tackle why I want to do this later herein...)
>
> $$PARMS{'foo'} = $PARMS{'foo'};
>
> ?? When I tried this (as a test, not looping over the hash) it didn't
> work (hence the original post)! The code was like this:
>
> $PARMS{'foo'} = "FOO";
> $$PARMS{'foo'} = $PARMS{'foo'};
$PARMS{'foo'} = "foo";
${$PARMS{'foo'}} = $PARMS{'foo'};
You can leave out all those single quotes, and use single quotes for the
simple constant:
$PARMS{foo} = 'foo';
${$PARMS{foo}} = $PARMS{foo};
> print "foo is $foo\n"; #does not print FOO, prints null
> $$_ = $PARMS{$_} for keys %PARMS;
> print "foo is $foo\n"; #prints FOO
> exit;
...
> Thanks for the help though. Be interested in hearing if you think
> that what I'm doing still really violates the spirit of using the
> 'strict pragma'.
Yes, it really violates the spirit of using the 'strict' pragma. But
that's OK, because you can use 'use strict;' in most of the program and
use 'no strict;' in a limited scope, and the 'strict' police won't come
after you.
> And, of course, your thoughts on why the $$PARMS
> assignment doesn't work!
I answered that above. It is a question of binding precedence, and Perl
variable names are case sensitive. $FOO isn't the same as $foo.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Wed, 31 May 2000 23:16:59 -0500
From: "Michael D. Kersey" <mdkersey@hal-pc.org>
To: Ilya Zakharevich <ilya@math.ohio-state.edu>
Subject: Re: if file already exists then remove...
Message-Id: <3935E3BB.22E3ED5F@hal-pc.org>
Ilya Zakharevich wrote:
<snipped>
> In my estimages Perl has an order of *thousands* of serious bugs.
> (And given almost no documentation for Perl, plenty of "debatable
> featurelets".)
IMHO there's almost too much documentation for Perl!-) I am in debt to
those hardworking persons who provide it and improve it.
> I doubt you can find a C compiler which comes within two orders of magnitude of this.
Could you show your methodology for computing
1) the earlier estimate that "Perl has an order of *thousands" of
serious bugs", and
2) this estimate (that no C compiler "comes within two orders of
magnitude of this")?
Notes:
a) your earlier post got off to a bad start by failing to define or
distinguish "scripting" languages and "programming" languages,
b) To compare Perl to C you would also have to include the C libraries,
c) Just because C has a simpler syntax and simpler BNF grammar does not
mean that any implementation of C is in any way "more correct" than
Perl,
d) Neither C nor Perl are used in proving programs correct,
e) Nor for that matter is FORTRAN, yet FORTRAN code is used in nuclear
reactor and plant monitoring systems all over the world. Does the fact
that FORTRAN programs cannot (theoretically or practically) be proven
correct cause us to hesitate to use them in life-critical applications?
(the answer is an emphatic "No!")
f) in the end, software development is an experimental science, not a
theoretical one. Programs are, for practical purposes, judged to be
"correct" not by mathematical proof, but by thorough testing. This holds
for compilers, too.
------------------------------
Date: Thu, 01 Jun 2000 03:14:03 GMT
From: cstrickland@surry.net (Charles W. Strickland)
Subject: Re: Is Perl for me?
Message-Id: <3935d279.2239015@nntp.surry.net>
Okay, I've done quite a bit of reading (even have Wall's book) about
Perl. I am primarily a Solaris/Linux SA, but have not really found a
source of unix Perl programs. I keep hearing about the benefits of
Perl and unix, but, as I say, have not found many examples of
applications. I am not slamming Perl. I can really see it's power.
I just want to see some useful examples.
I have written several cgi Perl programs for my web server. I am
still looking for unix applications.
------------------------------
Date: 1 Jun 2000 02:22:54 GMT
From: stanley@skyking.OCE.ORST.EDU (John Stanley)
Subject: Re: Julian Days
Message-Id: <8h4hdu$n1d$1@news.NERO.NET>
In article <393584B6.F896537B@coaps.fsu.edu>,
Stacey Campbell <campbell@coaps.fsu.edu> wrote:
>You see, localtime(time) gives 100 as the year (99 + 1), which must be
>modified to 2000 in order to determine if it's a leap year. You have to
>determine if it is a leap year, because if it is, you have to then add 1
>to the yday that localtime(time) returns.
Bzzzt. Thanks for playing.
>So you see, localtime(time) is not very efficient. Because of these
>problems, I'm worried about depending on localtime() to create my Julian
>Day file names automatically here at work. It could screw up data
>retrieval, file creation, and in general, data could be lost or written
>over.
I've used localtime (and gmtime) julian days for many years without
any trouble at all.
------------------------------
Date: Wed, 31 May 2000 22:11:08 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Looking for clever code bumming
Message-Id: <MPG.139f9044a8dfb40c98ab16@nntp.hpl.hp.com>
In article <aFhZ4.103541$R4.602111@news1.rdc1.nj.home.com>,
peter@lberghold.net says...
> In article <0OfZ4.96182$h01.690102@news1.rdc1.mi.home.com>, clintp@geeksalad.org (Clinton A. Pierce) wrote:
>
> > if ($_) {
> > $string.= $p->{grid}->[$sx]->[$sy];
> > push(@coord, [ $sx, $sy ]) ;
> > } else {
> > $string.=$p->{grid}->[$sy]->[$sx];
> > push(@coord, [ $sy, $sx ]);
> > }
> >
> How about:
> $string.= $p->{grid}->[$sx]->[$sy];
> ($_ ? push(@coord,[$sx , $sy]) : push(@coord,[$sy,$sx]));
No. You didn't conditionally interchange the indexes in the first line.
Samay has posted a correct solution.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Wed, 31 May 2000 18:14:28 -0400
From: jerrad pierce <jerrad@networkengines.com>
Subject: Re: Looking for clever code bumming
Message-Id: <39358EC4.A7A3F80@networkengines.com>
if ($_) {
$string.= $p->{grid}->[$sx]->[$sy];
push(@coord, [ $sx, $sy ]) ;
} else {
$string.=$p->{grid}->[$sy]->[$sx];
push(@coord, [ $sy, $sx ]);
}
becomes:
$string.= $p->{grid}->[($_ ? $sx : $sy)]->[($_ ? $sy : $sx)];
push(@coord, [ ($_ ? $sx : $sy), ($_ ? $sy : $sx) ]) ;
OR
($sx, $sy)=($sy, $sx) if $_;
$string.= $p->{grid}->[$sx]->[$sy];
push(@coord, [ $sx, $sy ]) ;
($sx, $sy)=($sy, $sx) if $_; #restore iff you need to reuse $sx $sy
------------------------------
Date: Thu, 01 Jun 2000 06:03:56 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: Looking for clever code bumming
Message-Id: <slrn8jejmo.1jg.tjla@thislove.dyndns.org>
I was shocked! How could Peter L. Berghold <peter@lberghold.net>
say such a terrible thing:
>In article <0OfZ4.96182$h01.690102@news1.rdc1.mi.home.com>, clintp@geeksalad.org (Clinton A. Pierce) wrote:
>
>> if ($_) {
>> $string.= $p->{grid}->[$sx]->[$sy];
>> push(@coord, [ $sx, $sy ]) ;
>> } else {
>> $string.=$p->{grid}->[$sy]->[$sx];
>> push(@coord, [ $sy, $sx ]);
>> }
>>
>How about:
>$string.= $p->{grid}->[$sx]->[$sy];
>($_ ? push(@coord,[$sx , $sy]) : push(@coord,[$sy,$sx]));
not quite. How about:
push@coord,(($a,$b)=($_?[$sx,$sy]:[$sy,$sx]));
$string.=$p->{grid}[$a][$b];
(going for a better golf score I guess :). My bet is I'll get whipped.
--
Gwyn Judd (tjla@guvfybir.qlaqaf.bet)
My return address is rot13'ed
Wait a minute, Marge. I saw "Mrs. Doubtfire." This is a man in drag!
-- Homer Simpson
Simpsoncalifragilisticexpiala(annoyed grunt)cious
------------------------------
Date: Thu, 01 Jun 2000 05:20:10 GMT
From: jlamport@calarts.edu
Subject: Re: MySQL problem: $DBI::errstr always null
Message-Id: <8h4rq4$bnf$1@nnrp1.deja.com>
In article <MPG.139d97aa1bc46afe98ab01@nntp.hpl.hp.com>,
Larry Rosler <lr@hpl.hp.com> wrote:
> In article <8gvn43$ltg$1@nnrp1.deja.com> on Tue, 30 May 2000 06:29:33
> GMT, jlamport@calarts.edu <jlamport@calarts.edu> says...
> > In article <8grtp2$4ho$1@nnrp1.deja.com>,
> > jsunden@my-deja.com wrote:
> > > Try omitting the $-sign and write DBI->errstr instead. Then it should
> > > work -- it does for me when I use it like this:
> > >
> > > $sth->execute or die "Something went wrong: ", DBI->errstr;
> >
> > Nope. Attempting to evaluate DBI->errstr causes my program to die with
> >
> > "Can't locate auto/DBI/errstr.al in @INC"
> >
> > Which makes sense to me, since as I understand it, I'm trying to access a
> > variable, not call a function...
> >
> > Any other suggestions?
>
> Yes. Either $DBI::errstr (which is a scalar variable that interpolates
> into double-quoted contexts just fine) or $dbh->errstr (which is a
> method invocation that doesn't interpolate). Here $dbh is the handle
> returned by the DBI connect() statement.
>
> <SNIP> of complete and unnecessary quote of the entire article being
> responded to, which wastes bandwidth inordinately. You used proper
> quoting style above; please stick with it.
Of course, if you'd actually bothered to read the "complete and
unnecessary quote of the entire article being responded to", rather than
summarily snipping it, you would have seen that your response wasn't
terribly helpful: my *original* problem was (and still is) precisely that
neither $DBI::errstr nor $dbh->errstr are returning any values: they are
always undefined, even after a $dbh->execute statement that returns an
error.
My current workaround looks something like this:
$dbh->{PrintError} = 1;
...
{
local $SIG{__WARN__} = sub { $error_msg = $_[0] };
$result = $sh->execute();
}
Which works for my purposes at the moment -- I get the error message
stuffed into $error_msg -- but I would still like to know why
$DBI::errstr and $dbh->errstr aren't working as documented.
As for quoting style, *my* quoting style works like this: I snip
anything from previous posts that has become irrelevant to the current
post; when my response is specific to a particular point/comment in a
previous post, I put my response immediately below that section of the
quoted previous post; when my response is more general, I do post
"jeopardy style": that way people who have been following the thread all
along don't have to scroll down through a whole bunch of text that
they've already read, while people who have just joined the thread can
still read the previous post and so see what I'm responding to. This is
how I personally prefer to see posts formatted, and so that's how I
format my posts, and until I see some evidence that this style is
annoying to the MAJORITY of usenet users, I will continue to do so.
Sorry, but I get kind of annoyed at those who insist that there is ONE
TRUE STYLE of usenet posting, and that anyone who deviates from this
style is some sort of sinner. The truth is that there is no one style
that's going to be most convenient for everyone, and while I admit that
there are a few posting habits that are almost universally annoying, I
don't think my post displayed any of them. (Okay, I probably should have
snipped off all of those extra "Sent via Deja.com..." sig lines. So sue
me.)
-jason
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 01 Jun 2000 03:23:41 GMT
From: "Ben Kennedy" <bkennedy99@home.com>
Subject: Re: oops Re: seeking method to encode email addresses in web pageforms
Message-Id: <1HkZ4.226537$Tn4.1992632@news1.rdc2.pa.home.com>
> Baloney, baloney, get rid of a few of those
> modules, write some custom error checking
> of your own, dump cgi.pm and write your own
> mangler, write your own Mickey Mouse watch.
>
> Why be happy with modules and all that stuff
> when you can do it your way, the right way?
> You are a purist programmer like myself, right?
why be happy with perl when you can write in C, or assembly? Why not write
all your own device drivers, the right way? Why use an operating system
someone else wrote when you can write your own? Why use the prefectly
functional CGI.pm when you can write your own? A programming purist does
not spend pointless time reinventing the wheel. Well, a programmer may take
the time to try to invent a *better* wheel, but for most common tasks, why
use your own potentially buggy code when there is a generally accepted,
popularly used and debugged version available? By the way, if you think you
have a better version of CGI.pm you should do the world a favor and package
it up into a distributable module so everyone can use it.
Ben Kennedy
------------------------------
Date: 1 Jun 2000 06:26:18 GMT
From: The WebDragon <nospam@devnull.com>
Subject: Re: oops Re: seeking method to encode email addresses in web pageforms
Message-Id: <8h4vma$a16$0@216.155.33.14>
In article <1HkZ4.226537$Tn4.1992632@news1.rdc2.pa.home.com>, "Ben
Kennedy" <bkennedy99@home.com> wrote:
| > Baloney, baloney, get rid of a few of those
| > modules, write some custom error checking
| > of your own, dump cgi.pm and write your own
| > mangler, write your own Mickey Mouse watch.
| >
| > Why be happy with modules and all that stuff
| > when you can do it your way, the right way?
| > You are a purist programmer like myself, right?
|
[snip]
| Why use the prefectly functional CGI.pm when you can write your own?
| A programming purist does not spend pointless time reinventing the
| wheel. Well, a programmer may take the time to try to invent a
| *better* wheel, but for most common tasks, why use your own
| potentially buggy code when there is a generally accepted, popularly
| used and debugged version available? By the way, if you think you
| have a better version of CGI.pm you should do the world a favor and
| package it up into a distributable module so everyone can use it.
Hear, hear!
Well? *tap tap tap* Let's see it! I'mmmm waaitingggggggg!
--
send mail to mactech (at) webdragon (dot) net instead of the above address.
this is to prevent spamming. e-mail reply-to's have been altered
to prevent scan software from extracting my address for the purpose
of spamming me, which I hate with a passion bordering on obsession.
------------------------------
Date: Thu, 01 Jun 2000 06:41:48 GMT
From: dninfo7454@my-deja.com
Subject: PERL developer wanted
Message-Id: <8h50jb$eff$1@nnrp1.deja.com>
Hostels.com is seeking a PERL developer for occassional projects mostly
involving cgi-scripts. Please email resume, references, and hourly rate
required to publisher@hostels.com.
Thank you.
Darren Overby, Publisher
Hostels.c
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 01 Jun 2000 02:19:57 GMT
From: perl@imchat.com (Mark P.)
Subject: Re: PERL JOBS =?iso-8859-1?Q?=28=A340k+=29?=
Message-Id: <3935c7d7.110958529@news.ionet.net>
On 31 May 2000 23:33:04 GMT, dha@panix.com (David H. Adler) wrote:
They didn't read that, and they never will read the reply or stop
posting so your message has been a waste of time.
Unfortunate but true.....
Just ignore them!
MP
------------------------------
Date: Wed, 31 May 2000 23:01:50 -0400 (EDT)
From: Mr_MiMiK@webtv.net (Mr MiMiK)
Subject: perl sites?
Message-Id: <17493-3935D21E-89@storefull-244.iap.bryant.webtv.net>
--WebTV-Mail-15791-4164
Content-Type: Text/Plain; Charset=US-ASCII
Content-Transfer-Encoding: 7Bit
can u ppl please tell me of some good sites on perl, wether is be
tutorials, scripts, or ur personal page, thanx
--WebTV-Mail-15791-4164
Content-Description: signature
Content-Disposition: Inline
Content-Type: Text/HTML; Charset=US-ASCII
Content-Transfer-Encoding: 7Bit
<html>
<body
background="http://www.mycgiserver.com/~w3btv-tricks/D4WG_P4CK_BG.jpg"
text="505050">
<center><table bgcolor="191919" cellspacing="3" cellpadding="0"
align="center" link="2222bb" vlink="8822bb"><font color="44cc55">
<tr>
<td href="http://www.wtv-zone.com/dawg/" bgcolor="black"
gradcolor="191919" width="310" height="38" align="center"><font
color="44cc55"><font color="505050" size="6"
effect="shadow"><blackface>D4WG P4CK</blackface></font></td>
</tr>
</table>
</center>
</html>
--WebTV-Mail-15791-4164--
------------------------------
Date: Wed, 31 May 2000 21:52:31 -0400
From: "Alex Shi" <chpshi@connection.com>
Subject: Problem of perl on NT IIS
Message-Id: <3935c25c@news.connection.com>
Hi all,
I have a mail_form.pl on a NT web server (IIS). I have asked
the administrator installed a Active Perl 5. But the cgi still
doesn't work. If I type the cgi's url in a brower's address
cell and hit return, IE browser will list the script itself in
its window, and netscape communicator will download it! I just
don't know what's wrong with the perl. The web server is US and
I am Toronto...I can talk with the administrator but I don't
know what's wrong with it:(((
Still I have another question. In this mail_form.pl, it make
use of sendmail as a SMTP client to send email. The original
mailprog was defined as
$mailprog = "/usr/sbin/sendmail -t";
because it is now installed on NT, some one has customized it
as
$mailprog = "\\sendmail\\sendmail -t";
and commented the original one with "#".
I am just wondering whether it can works. Is there a "sendmail"
on NT platform?
I really wish you can help me.
Thanks!
Alex
--
--------------------------------------------------
Please visit http://www.stonix.com
Please subscribe to our E-commerce newsletter:
subscribe-ecdigest@stonix.com?subject=Subscribe
Join Our E-commerce Survey to get $10 credit!
http://www.stonix.com/cgi-bin/load_survey.pl
Get your free email at http://stonix.zzn.com
--------------------------------------------------
------------------------------
Date: Thu, 01 Jun 2000 02:25:03 GMT
From: perl@imchat.com (Mark P.)
Subject: Re: problem with perl garbage collecting
Message-Id: <3935c94b.111330514@news.ionet.net>
On Wed, 31 May 2000 13:23:01 GMT, poppln@my-deja.com wrote:
>I'm running a perl script that process a fairly big file containing
>structures stored with the Storable method.
>
>The problem is that when I run the script with out the debugger
>( perl -w <script-name> ...) the process memory grows very rapidly ( >
>100MB)
>but if I run it WITH the debugger ( perl -wd <script-name> ...) the
>process size is stable and peaks at about 16MB.
>Does any body have any idea why this is happening and how to solve it?
Some code maybe?
MP
------------------------------
Date: 1 Jun 2000 02:24:38 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: problem with perl garbage collecting
Message-Id: <8h4hh6$i2m$1@charm.magnus.acs.ohio-state.edu>
[A complimentary Cc of this posting was sent to
<poppln@my-deja.com>],
who wrote in article <8h33n5$6cc$1@nnrp1.deja.com>:
> I'm running a perl script that process a fairly big file containing
> structures stored with the Storable method.
>
> The problem is that when I run the script with out the debugger
> ( perl -w <script-name> ...) the process memory grows very rapidly ( >
> 100MB)
> but if I run it WITH the debugger ( perl -wd <script-name> ...) the
> process size is stable and peaks at about 16MB.
Even if the debugger is run non-interactively in non-stop mode?
If yes, try to fiddle with bits of $^P until you can reproduce the
change without -d. Keep in mind that with a Perl so old directly
fiddling with a couple of bits of $^P would lead to a segfault. [But
you will find them soon enough. ;-]
Ilya
------------------------------
Date: 1 Jun 2000 02:06:29 GMT
From: Martin Julian DeMello <mdemello@pound.ruf.rice.edu>
Subject: Re: Problems with Tree::Trie
Message-Id: <8h4gf5$sv$1@joe.rice.edu>
Martin Julian DeMello <mdemello@pound.ruf.rice.edu> wrote:
> Being a complete newbie to perl I'm extremely reluctant to try to debug the
> module itself :) Are there any known issues, or am I just doing something
> wrong? Code follows.
Okay, I bit the bullet and spent a few hours with the code, the wonderful
perldsc manpage and a friend who knows a heck of a lot more perl than I do,
and traced it. Turned out there was a problem, which I fixed and sent in.
Plus I actually understand references and complex data structures now.
Well, at least until the next bug proves me wrong, but c'est la vie. :)
Here's the patch in case I've overlooked something...
--- Tree/Trie.pm~ Wed May 31 20:29:27 2000
+++ Tree/Trie.pm Wed May 31 20:46:33 2000
@@ -50,7 +50,16 @@ sub add {
else {
# Once we find an letter for which there is no branch then we
# call the internal populate function to fill it in.
- $ref->{$letter} = _populate(@letters);
+
+ if (scalar @letters) {
+ $ref->{$letter} = _populate(@letters);
+ } else {
+ #have to handle the single-letter case separately, since
+ #_populate expects a nonempty array
+ $ref->{$letter} = undef; #leaf node gets added later on
+ $ref = \%{ $ref->{$letter} };
+ last;
+ }
# Update the applicable counter...
if (wantarray) {
push(@retarray,$word);
--
Martin DeMello (somewhat less of a newbie)
------------------------------
Date: Thu, 1 Jun 2000 00:45:05 -0400
From: "Theodore G. Paulakis" <paulakis@seas.upenn.edu>
Subject: Remote .htpasswd editting
Message-Id: <8h4pp8$leg$1@netnews.upenn.edu>
I've been forever searching on the web for a perl script that lets an
authenticated user change his password (and his password alone) without
compromising the security of the other .htpasswd entries. All I found was C
program that didn't even compile, and plus my server doesn't even support
cgi scripts written in C (only those written in Perl). Please help!
~T
------------------------------
Date: 1 Jun 2000 06:52:16 GMT
From: The WebDragon <nospam@devnull.com>
Subject: Re: runtime errors - Q how to do this
Message-Id: <8h5170$fj4$0@216.155.33.14>
In article <8h3fok$5i$1@sshuraab-i-1.production.compuserve.com>, Dick
Nickalls dicknickallscompuservecom <100115.1010@CompuServe.COM> wrote:
| Am I missing something here, or am I just trying to do
| the ompossible?? :-)
you must meditate on the question, grasshopper, before you receive
enlightenment..
do I warn or die?
perl finds parroty error
it's bleedin' demised
:D
hey, is this good enough for the haiku contest?
the format IS 5-7-5 right? I forget :|
--
send mail to mactech (at) webdragon (dot) net instead of the above address.
this is to prevent spamming. e-mail reply-to's have been altered
to prevent scan software from extracting my address for the purpose
of spamming me, which I hate with a passion bordering on obsession.
------------------------------
Date: 1 Jun 2000 04:06:50 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: WIN32: cant redir STDOUT to a file
Message-Id: <8h4ngq$6l5$2@slb6.atl.mindspring.net>
undergronk@yahoo.com wrote:
: This seems like such an easy thing to do, but I must admit defeat and
: ask what seems to be a dumb question.
:
: Using Perl V5.6.0 (from ActiveState) for Win32 I have some fairly
: simple scripts which print to STDOUT.
[snip]
: This works OK, but if I try to redirect the output to a file, all I get
: is an empty file, even after the script has finished.
If you're running under NT and you've used file associations so that you
can execute the script by just typing its name, you're running up against
a bu^h^hfeature in NT's shell that makes output from such scripts
un-redirectable. Try invoking the script by typing 'perl scriptname';
redirection will work properly with that.
------------------------------
Date: Wed, 31 May 2000 21:17:49 -0400
From: "J::Lambert" <ittso.3wing@videotron.ca>
Subject: win32:MAPI Email and CGI - http://here.at/perl
Message-Id: <JTiZ4.4671$B_1.159733@weber.videotron.net>
Does anyone found a way to send an Email using the MAPI layer of a win32 OS
(through Outlook 97) from a perl / cgi script ?
I have tried win32:MAPI - works only in cmd prompt mode.
I've tried Mail:Sender - works only with SMTP, doesn't use MAPI
Our mail server is Exchange and it doesn't suppport internet mail (SMTP or
POP)
Ever seen something like this ?
Thanks,
J. Lambert
http://here.at/perl
------------------------------
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 3226
**************************************