[17716] in Perl-Users-Digest
Perl-Users Digest, Issue: 5136 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Dec 17 18:15:32 2000
Date: Sun, 17 Dec 2000 15:15: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: <977094913-v9-i5136@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Sun, 17 Dec 2000 Volume: 9 Number: 5136
Today's topics:
Re: deskcode.com hot new perl resource read more (Tad McClellan)
Re: deskcode.com hot new perl resource read more (Steven Smolinski)
Re: deskcode.com hot new perl resource read more (Tad McClellan)
Re: desperate newbie: Perl and HTML <webmaster@MaximumEdge.com>
Re: dynamic require & new on variable package (M.J.T. Guy)
Re: dynamic require & new on variable package <jeffp@crusoe.net>
Getting around named pipe blocking? (Gregory Spath)
Re: Getting around named pipe blocking? <joe+usenet@sunstarsys.com>
Re: Is there an overhead using long variable names? (Tad McClellan)
Re: Is there an overhead using long variable names? (Ben Okopnik)
Re: Language evolution C->Perl->C++->Java->Python (Is P (Chris Fedde)
Re: Language evolution C->Perl->C++->Java->Python (Is P <willem@veenhoven.com>
Re: Language evolution C->Perl->C++->Java->Python (Is P <bowman@montana.com>
Re: Language evolution C->Perl->C++->Java->Python (Is P <roedy@mindprod.com>
Re: Language evolution C->Perl->C++->Java->Python (Is P <cdsmith@twu.net>
Re: linked lists and recursive functions (Tad McClellan)
Re: MLDBM? adding/modifying records? (Bruce Wayne)
Re: One-Liner to Sum a Stack of Numbers? (Abigail)
Re: One-Liner to Sum a Stack of Numbers? (Tad McClellan)
perl vote script. johnvert@my-deja.com
Re: perl vote script. <krahnj@acm.org>
Ramblings (was Re: Language evolution C->Perl->C++->Jav <nospam@david-steuber.com>
Re: Sendmail script problems (Brian Pontz)
Splitting data into an array <someguyREMOVE@REMOVEsunflower.com>
Re: Splitting data into an array <uri@sysarch.com>
SSI and cookies <rvdb@comweb.nl>
Re: Use PERL or Java? Which is faster? (Peter Schuller)
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sun, 17 Dec 2000 10:34:13 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: deskcode.com hot new perl resource read more
Message-Id: <slrn93pn7l.1m3.tadmc@magna.metronet.com>
deskcode@my-deja.com <deskcode@my-deja.com> wrote:
>Subject: deskcode.com hot new perl resource read more
^^^ ^^^^^^^^^^^^^
>Offers resources to 15 different programming languages.
A "Power Search" at deja for "deskcode@my-deja.com" reveals
16 posts.
All of them today.
All of them an advertisement for a spammer's website.
>Please come and visit us,
This poster is a spammer. Don't go there.
>share your knowledge by submitting articles,
>tutorials, code snippets, or whole programs.
>We really need the boost in our perl resources.
^^ ^^^^
^^ ^^^^
And what would we be getting in return?
How can it be "hot" and "need a boost" at the same time?
You are a con man. Go away.
All 16 of the spam posts say they need a boost in the area
of the newsgroup's topic.
I guess there isn't _anything_ there yet. Why go?
--
Tad McClellan SGML consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Sun, 17 Dec 2000 17:24:57 GMT
From: sjs@yorku.ca (Steven Smolinski)
Subject: Re: deskcode.com hot new perl resource read more
Message-Id: <slrn93q1jk.19m.sjs@ragnar.stevens.gulch>
Tad McClellan <tadmc@metronet.com> wrote:
> deskcode@my-deja.com <deskcode@my-deja.com> wrote:
> >Please come and visit us,
>
> This poster is a spammer. Don't go there.
I stumbled across this site. It's nearly bare.
> I guess there isn't _anything_ there yet. Why go?
Oh, Tad, how wrong you are! There were two webpage hit counter
programs, both broken.
Steve
--
Steven Smolinski => http://www.steven.cx/
------------------------------
Date: Sun, 17 Dec 2000 16:34:51 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: deskcode.com hot new perl resource read more
Message-Id: <slrn93qcbr.2sk.tadmc@magna.metronet.com>
Steven Smolinski <sjs@yorku.ca> wrote:
>Tad McClellan <tadmc@metronet.com> wrote:
>> deskcode@my-deja.com <deskcode@my-deja.com> wrote:
>> >Please come and visit us,
>>
>> This poster is a spammer. Don't go there.
>
>I stumbled across this site. It's nearly bare.
>
>> I guess there isn't _anything_ there yet. Why go?
>
>Oh, Tad, how wrong you are!
I think that happened once before too...
>There were two webpage hit counter
>programs, both broken.
And it gets worse.
I kinda expected that the deja address wasn't real.
But even mail to postmaster@deskcode.com bounces:
<postmaster@deskcode.com>:
216.234.161.182 does not like recipient.
Remote host said: 553 sorry, that domain isn't in my list of
allowed rcpthosts (#5.7.1)
postmaster will not accept email!
A sure sign of a professional spammer.
--
Tad McClellan SGML consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Sun, 17 Dec 2000 19:30:05 -0000
From: MaximumEdge.com <webmaster@MaximumEdge.com>
Subject: Re: desperate newbie: Perl and HTML
Message-Id: <t3q51ttcrh2d34@corp.supernews.com>
Hello,
You can pass the variably through a form element like this:
<form type=hidden name=variable value=a1>
Regards,
Jason Weinstein
webmaster@MaximumEdge.com
http://www.MaximumEdge.com/
manon_bertolini wrote:
>
>
> Hello there!
>
> I am very new at Perl and I wanted to know - is it possible to retrieve
> a value stored in a variable from HTML or Javascript into Perl?
>
> My code in the HTML doc
> "<input type=radio name=Question value=ans1>" + a1 + "<BR><BR>" + ...
>
> Where "a1" contains a string, and I want that string passed to Perl.
>
>
> Or can Perl evaluate whther a radio button is checked on an outside HTML
> form?
> Thanks!
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
--
Posted via CNET Help.com
http://www.help.com/
------------------------------
Date: 17 Dec 2000 15:31:05 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: dynamic require & new on variable package
Message-Id: <91im7p$7vo$1@pegasus.csx.cam.ac.uk>
Bob Walton <bwalton@rochester.rr.com> wrote:
>Well, Perl will interpolate the double-quoted string
>
> "$object = $o_type->new();"
>
>getting
>
> = Driver::Type1->new();
... and would also have generated a warning if you'd bothered to use -w,
which might have told the OP what's going on.
Mike Guy
------------------------------
Date: Sun, 17 Dec 2000 10:50:46 -0500
From: Jeff Pinyan <jeffp@crusoe.net>
Subject: Re: dynamic require & new on variable package
Message-Id: <Pine.GSO.4.21.0012171045540.22284-100000@crusoe.crusoe.net>
On Dec 17, M.J.T. Guy said:
>Bob Walton <bwalton@rochester.rr.com> wrote:
>>Well, Perl will interpolate the double-quoted string
>>
>> "$object = $o_type->new();"
>>
>>getting
>>
>> = Driver::Type1->new();
>
> ... and would also have generated a warning if you'd bothered to use -w,
>which might have told the OP what's going on.
If the OP hadn't be using whitespace there, then a problem would have
arisen:
#!/usr/bin/perl -w
use CGI;
$class = 'CGI';
eval "$object=$class->new()";
print $@ if $@;
eval "$object = $class->new()";
print $@ if $@;
Output:
Use of uninitialized value at - line 5.
Use of uninitialized value at - line 8.
syntax error at (eval 2) line 1, near "="
The reason there is no $@ after the first eval() is due to the fact that
"=CGI->new()" looks like POD. :)
--
Jeff "japhy" Pinyan japhy@pobox.com http://www.pobox.com/~japhy/
CPAN - #1 Perl Resource (my id: PINYAN) http://search.cpan.org/
PerlMonks - An Online Perl Community http://www.perlmonks.com/
The Perl Archive - Articles, Forums, etc. http://www.perlarchive.com/
------------------------------
Date: Sun, 17 Dec 2000 21:00:05 -0000
From: gspath@freefall.homeip.net (Gregory Spath)
Subject: Getting around named pipe blocking?
Message-Id: <slrn93qa8r.cft.gspath@freefall.homeip.net>
Hi all,
I am trying to write a daemon that responds to commands sent to it via a named
pipe, but must also listen to a persistent stream of data from another process.
I don't need anything fancy, so have avoided writing a full-blown socket
client/server set.
The way I tried to get around the blocking nature of the FIFO (named pipe) was
to fork it off as its own process. I have all three processes forked and
running. I have input/output from the parent to the streaming process, and
only input from the process that listens to the named pipe for commands.
It all works...but my main process gets blocked when the named pipe reader
process is running. Send input to the pipe, and I get the next
line...meanwhile the other stream of data isn't getting through.
Why is this happening??? I thought the whole idea of forking was to allow each
process to run independently and then report back to the parent. Why is it
that when the child blocks on the named pipe, the parent is also blocked???
Here is a snippet from the parent:
if ($pid = fork){
parent($pid);
} else {
child();
}
# Parent stuff -- gets input from named pipe child and from streaming child,
# sends commands to streaming child
sub parent{
my $pid = shift;
my $pid2;
my $line;
my $line2;
# Launch the second fork to look for user input and run control loop
if ($pid2 = open(CHILD2, "-|")){
close PARENT;
while (1){
chomp ($line=<CHILD>); #### This is the streaming program
chomp ($line2=<CHILD2>); #### This is the child that is blocking :(
print "$$ $pid $pid2\n"; #### Verifying I actually have 3 unique PIDs
}
close CHILD;
waitpid($pid, 0);
} else {
child2();
}
Any help is appreciated. Please CC: me in email if possible.
TIA,
-- Greg
--
Gregory Spath
gspath@freefall.homeip.net http://freefall.homeip.net/
SCHeckler on IRC ----------> http://freefall.homeip.net/javairc/
Team YBR ------------------> http://www.yellowbreechesracing.org/
------------------------------
Date: 17 Dec 2000 17:07:22 -0500
From: Joe Schaefer <joe+usenet@sunstarsys.com>
Subject: Re: Getting around named pipe blocking?
Message-Id: <m3bsuasnvp.fsf@mumonkan.sunstarsys.com>
gspath@freefall.homeip.net (Gregory Spath) writes:
> The way I tried to get around the blocking nature of the
> FIFO (named pipe) was to fork it off as its own process.
I didn't see any FIFO in the code you wrote, but you can get
around FIFO's blocking on open calls by opening with O_RDWR
set either with sysopen or open with <+ or >+ prefixes -
note that the latter is generally discouraged (see
perldoc -q wipe) but I've found it occasionally useful for
FIFO's on linux. It might not work for FIFO's on other OS's.
> Here is a snippet from the parent:
[...]
> chomp ($line=<CHILD>); #### This is the streaming program
> chomp ($line2=<CHILD2>); #### This is the child that is blocking :(
I would guess that you haven't set the autoflush ($|=1)
on your 2nd child process, ie.
sub child2() {
# local $| = 1;
while(1) {
print "accumulating input in STDOUT's buffer\n";
sleep 1;
}
}
Uncomment the local $|=1 line and see if it makes
any difference in your program.
Usually STDOUT is line-buffered to the terminal and
block-buffered otherwise- see
% man perlvar
% man perlipc
for details.
HTH.
--
Joe Schaefer
------------------------------
Date: Sun, 17 Dec 2000 11:11:35 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Is there an overhead using long variable names?
Message-Id: <slrn93ppdn.1m3.tadmc@magna.metronet.com>
Ben Okopnik <fuzzybear@pocketmail.com> wrote:
>The ancient archives of 15 Dec 2000 10:12:00 -0700 showed
>Tom Christiansen of comp.lang.perl.misc speaking thus:
>>In article <91dic4$jt8$1@boomer.cs.utexas.edu>,
>>Logan Shaw <logan@cs.utexas.edu> wrote:
>>>Huh? Are you saying that you expect the variation to be so small
>>In any event, this is FALSE EFFICIENCY. Efficiency-chasing is often
>>a sign of a mis-directed novice programmer. There's thinking about
>>the absolute wrong thing.
>>
>>Stop chasing microseconds. Duh.
>>Efficiency is the hobgoblin of little programmers. Rule 1 of
>>optimization is: Don't!
>
>
>And now, a message from one of the little programmers... :\
>
>Can anyone recommend a "general principles of programming" book that would
>talk about about this kind of stuff? I mean, avoiding the bad practices
^^^^^^^^^
>and using the good ones,
Some other applicable search terms:
Software (Engineering|Process|Design|Methodology)
There is a newsgroup for discussing such things. Subscribe
or do an archive search:
comp.software-eng
>not even necessarily WRT a specific language (and
^^^^^^^^^^^
That should be _preferably without_ respect to a specific language :-)
The "best" resources discuss the issues. The language used (if any)
should be incidental.
>I've been cranking out code
>for <mumble-mumble> years now,
I did the same thing for several years, being initally trained as an EE.
>in close to a dozen different languages -
>but it's been mostly a "learn as you go" experience, though I've written
>some fair-sized apps. I knew about "efficiency-chasing", but I'm not so
>sure about other pitfalls.
I eventually noticed that my (hobbyist) programming projects
would get about 80-90 percent complete, and then languish unfinished.
When my real job changed from HW to SW work, I figured I better
do something about that. I went back to school.
Nowadays I think about what I am going to code *before*
I start coding it :-)
--
Tad McClellan SGML consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: 17 Dec 2000 18:49:33 GMT
From: fuzzybear@pocketmail.com (Ben Okopnik)
Subject: Re: Is there an overhead using long variable names?
Message-Id: <slrn93q2lv.bd.fuzzybear@Odin.Thor>
The ancient archives of Sun, 17 Dec 2000 11:11:35 -0500 showed
Tad McClellan of comp.lang.perl.misc speaking thus:
>Ben Okopnik <fuzzybear@pocketmail.com> wrote:
>>
>>And now, a message from one of the little programmers... :\
>>
>>Can anyone recommend a "general principles of programming" book that would
>>talk about about this kind of stuff? I mean, avoiding the bad practices
> ^^^^^^^^^
>>and using the good ones,
>
>
>Some other applicable search terms:
>
> Software (Engineering|Process|Design|Methodology)
>
>There is a newsgroup for discussing such things. Subscribe
>or do an archive search:
>
> comp.software-eng
Done!
>>not even necessarily WRT a specific language (and
> ^^^^^^^^^^^
>
>That should be _preferably without_ respect to a specific language :-)
You're right, of course - but there are people who will insist that only
their Holy Grail is efficient, and no other comes close. <shrug> I don't
mind abstracting the info I need.
>The "best" resources discuss the issues. The language used (if any)
>should be incidental.
>
>
>>I've been cranking out code
>>for <mumble-mumble> years now,
>
>
>I did the same thing for several years, being initally trained as an EE.
<Grin> Brother!
>>in close to a dozen different languages -
>>but it's been mostly a "learn as you go" experience, though I've written
>>some fair-sized apps. I knew about "efficiency-chasing", but I'm not so
>>sure about other pitfalls.
>
>
>I eventually noticed that my (hobbyist) programming projects
>would get about 80-90 percent complete, and then languish unfinished.
>
>When my real job changed from HW to SW work, I figured I better
>do something about that. I went back to school.
That's what I'm getting ready to do now. I guess I'm not doing too badly
for a guy taking a SWAG...
>Nowadays I think about what I am going to code *before*
>I start coding it :-)
I've been doing _that_ for a long time, as well - just without any formal
training (or anything other than fair guesses based on experience.)
Thanks!
Ben Okopnik
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
There is no limit to stupidity. Space itself is said to be bounded by its
own curvature, but stupidity continues beyond infinity. -- Gene Wolfe
------------------------------
Date: Sun, 17 Dec 2000 22:49:55 GMT
From: cfedde@fedde.littleton.co.us (Chris Fedde)
Subject: Re: Language evolution C->Perl->C++->Java->Python (Is Python the ULTIMATE oflanguages??)
Message-Id: <nqb%5.295$B9.188798976@news.frii.net>
In article <3A3C920C.35794C90@nowhere.com>,
Just Me <just_me@nowhere.com> wrote:
>Try writing this in your favourite language:
>
> 1000 factorial
> -> a very large number which causes overflow if
> not evaluated in Smalltalk
>
Here is one in perl...
cat fact.pl
use Math::BigInt;
sub fact {
my $n = shift;
if ($n == 0){
return 1;
} else {
return $n * fact($n-1);
}
}
print fact(Math::BigInt->new($ARGV[0])), "\n";
It's not very fast though:
real 0m10.433s
user 0m10.104s
sys 0m0.033s
Ruby seems to be able to do it much faster...
$ cat fact.rb
def fact(n)
if n == 0
1
else
n * fact(n-1)
end
end
$ print fact(ARGV[0].to_i), "\n"
time ruby fact.rb 1000
real 0m0.129s
user 0m0.086s
sys 0m0.034s
Ruby is very much like smalltalk with a procedural language verneer and
many of the 'good things' from Perl.
Both output what I suspect is the correct value...
4023872600770937735437024339230039857193748642107146325437999104299385123986290
2059204420848696940480047998861019719605863166687299480855890132382966994459099
7424504087073759918823627727188732519779505950995276120874975462497043601418278
0946464962910563938874378864873371191810458257836478499770124766328898359557354
3251318532395846307555740911426241747434934755342864657661166779739666882029120
7379143853719588249808126867838374559731746136085379534524221586593201928090878
2973084313928444032812315586110369768013573042161687476096758713483120254785893
2076716913244842623613141250878020800026168315102734182797770478463586817016436
5024153691398281264810213092761244896359928705114964975419909342221566832572080
8213331861168115536158365469840467089756029009505376164758477284218896796462449
4516076535340819890138544248798495995331910172335555660213945039973628075013783
7615307127761926849034352625200015888535147331611702103968175921510907788019393
1781141945452572238655414610628921879602238389714760885062768629671466746975629
1123408243920816015378088989396451826324367161676217916890977991190375403127462
2289988005195444414282012187361745992642956581746628302955570299024324153181617
2104658320367869061172601587835207515162842255402651704833042261439742869330616
9089796848259012545832716822645806652676995865268227280707578139185817888965220
8164348344825993266043367660176999612831860788386150279465955131156552036093988
1806121385586003014356945272242063446317974605946825731037900840244324384656572
4501440282188525247093519062092902313649327349756551395872055965422874977401141
3346962715422845862377387538230483865688976461927383814900140767310446640259899
4902222217659043399018860185665264850617997023561938970178600408118897299183110
2117122984590164192106888438712185564612496079872290851929681937238864261483965
7382291123125024186649353143970137428531926649875337218940694281434118520158014
1233448280150513996942901534830776445690990731524332782882698646027898643211390
8350621709500259738986355427719674282224875758676575234422020757363056949882508
7968928162753848863396909959826280956121450994871701244516461260379029309120889
0869420285106401821543994571568059418727489980942547421735824010636774045957417
8516082923013535808184009699637252423056085590370062427124341690900415369010593
3983835777939410970027753472000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000
chris
--
This space intentionally left blank
------------------------------
Date: Sun, 17 Dec 2000 22:26:12 +0100
From: willem veenhoven <willem@veenhoven.com>
Subject: Re: Language evolution C->Perl->C++->Java->Python (Is Python the ULTIMATE oflanguages??)
Message-Id: <3A3D2F74.BB87BDE4@veenhoven.com>
Al Dev wrote:
>
> [snip]
Just an other frustrated small group of fanatics?
I never heard of Python before, did you?
Anyhow, I checked out Python.org and my personal opinion is that five
people part time do not make an org ...
willem
------------------------------
Date: Sun, 17 Dec 2000 08:40:11 -0700
From: "bowman" <bowman@montana.com>
Subject: Re: Language evolution C->Perl->C++->Java->Python (Is Python the ULTIMATE of languages??)
Message-Id: <Zb5%5.1546$N84.6848@newsfeed.slurp.net>
David Steuber <nospam@david-steuber.com> wrote in message
>
> Senile dimentia is a terrible thing. If Python is so great, why is it
> written in C, a language which is alleged to have mistakes in it?
because CPython is a hell of a lot faster than JPython.....
------------------------------
Date: Sun, 17 Dec 2000 20:28:44 GMT
From: Roedy Green <roedy@mindprod.com>
Subject: Re: Language evolution C->Perl->C++->Java->Python (Is Python the ULTIMATE of languages??)
Message-Id: <088q3t4is7o74egh40rqgl6i0fdbubqpuu@4ax.com>
On Sat, 16 Dec 2000 17:08:38 GMT, Al Dev <alavoor-nospam@yahoo.com>
wrote or quoted :
>o Probably it is impossible to develop a programming language which is
>better
> than Python. (Is Python the ultimate programming language ????)
I am not a great fan of ad hominem arguments. However that claim is so
ludicrous it yanks the rug out from under your credibility. Everything
else you have claimed is now suspect, even the stuff that is true,
e.g. that Python is terser and more readable.
------------------------------
Date: Sun, 17 Dec 2000 16:30:57 -0600
From: "Chris Smith" <cdsmith@twu.net>
Subject: Re: Language evolution C->Perl->C++->Java->Python (Is Python the ULTIMATE oflanguages??)
Message-Id: <91jern$s0i$0@dosa.alt.net>
willem veenhoven <willem@veenhoven.com> wrote ...
> Just an other frustrated small group of fanatics?
>
> I never heard of Python before, did you?
Yes, Python is a fairly well-known, though fairly new, language. Don't
judge the entire Python language by what some moron posts on USENET. Just
ignore the thread and let it die... don't feul it.
Chris Smith
------------------------------
Date: Sun, 17 Dec 2000 11:16:39 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: linked lists and recursive functions
Message-Id: <slrn93ppn7.1m3.tadmc@magna.metronet.com>
Oliver Söder <soeder@ai-lab.fh-furtwangen.de> wrote:
>I am able to programm C++ and know how to use $subject there.
>
>Is it possible to use these functions under perl?
Yes.
>I already tried,
We cannot help you fix what you tried if you don't show it to us.
Were you using references?
>but there ist no Heap and Stack like under C++.
If you like, you can think of Perl's two kinds of scope
that way:
dynamic variables (stackish)
lexical variable (heapish)
Using push() and pop() give you a stack data structure too.
Perl FAQ, part 7:
"What's the difference between dynamic and lexical (static) scoping?
Between local() and my()?"
--
Tad McClellan SGML consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Sun, 17 Dec 2000 18:10:51 GMT
From: janewaysdream@startrekmail.com (Bruce Wayne)
Subject: Re: MLDBM? adding/modifying records?
Message-Id: <3a3d015b.450018@news.direct.ca>
Thanks Bob with all my heart...
found another one of your posts on MLDBM and i posted a reply there
theanking you profusely for your kindassistance
still wonderind about deleting records etc,,, but you gave me both
legs in in your other post,,,, so thanks again
Bruce Wayne,
Vancouver Island, Canada.
On Sun, 17 Dec 2000 07:45:25 GMT, Bob Walton
<bwalton@rochester.rr.com> wrote:
>Bruce Wayne wrote:
>>
>> using 'MLDBM #$#$%$
>> Has anyone come across some "UNencrypted" instructions for adding,
>> modifying, or deleting records within an MLDBM muti-dimensional DBM
>> file???
>...
>> Bruce.
>I'm not sure exactly what you mean, but I would recommend looking over
>recipes 11.14, 14.8, and 14.9 in "Perl Cookbook".
>--
>Bob Walton
------------------------------
Date: 17 Dec 2000 17:08:16 GMT
From: abigail@foad.org (Abigail)
Subject: Re: One-Liner to Sum a Stack of Numbers?
Message-Id: <slrn93pso0.epp.abigail@tsathoggua.rlyeh.net>
On Sat, 16 Dec 2000 01:20:06 GMT, SuperGumby (tick.toff@spam.com) wrote in comp.lang.perl.misc <URL: news:<arz_5.19724$xW4.156568@news-server.bigpond.net.au>>:
++ OK OK, having just commented in another post on the proliferation of
++ oneliners,,, How can this be described as a oneliner ? Theoretically it
++ seems to me any perl program can be written sans <cr> but this thing has a
++ 'statement terminator' in the middle of it.
Perl doesn't have statement terminator.
If you don't like semi-colons:
(process) | perl -nle 'END {print $s} $s += $_'
And don't post Jeopardy style!
Abigail
------------------------------
Date: Sun, 17 Dec 2000 16:38:31 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: One-Liner to Sum a Stack of Numbers?
Message-Id: <slrn93qcin.2sk.tadmc@magna.metronet.com>
Abigail <abigail@foad.org> wrote:
>On Sat, 16 Dec 2000 01:20:06 GMT, SuperGumby (tick.toff@spam.com) wrote in comp.lang.perl.misc <URL: news:<arz_5.19724$xW4.156568@news-server.bigpond.net.au>>:
>++ OK OK, having just commented in another post on the proliferation of
>++ oneliners,,, How can this be described as a oneliner ? Theoretically it
>++ seems to me any perl program can be written sans <cr> but this thing has a
>++ 'statement terminator' in the middle of it.
>
>Perl doesn't have statement terminator.
Perl instead has a "statement separator" (semicolon).
Hence not needing a semicolon on the last statement in a block
(because there is nothing to "separate").
--
Tad McClellan SGML consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Sun, 17 Dec 2000 19:23:45 GMT
From: johnvert@my-deja.com
Subject: perl vote script.
Message-Id: <91j3rt$5f4$1@nnrp1.deja.com>
Hi, I'm not sure if this is the right place to ask this, but I'm only
looking for a pointer: I want a very simple poll script just like the
one on http://www.slashdot.org. It's not difficult to do myself but
it's been written so many times it's ridiculous to reinvent it. I
thought it would be a piece of cake to find stuff like this on google,
but I couldn't. Does anyone know where I can get it?
Thanks,
-- John
Sent via Deja.com
http://www.deja.com/
------------------------------
Date: Sun, 17 Dec 2000 22:32:30 GMT
From: "John W. Krahn" <krahnj@acm.org>
Subject: Re: perl vote script.
Message-Id: <3A3D3F84.8C9391C9@acm.org>
johnvert@my-deja.com wrote:
>
> Hi, I'm not sure if this is the right place to ask this, but I'm only
> looking for a pointer: I want a very simple poll script just like the
> one on http://www.slashdot.org. It's not difficult to do myself but
> it's been written so many times it's ridiculous to reinvent it. I
> thought it would be a piece of cake to find stuff like this on google,
> but I couldn't. Does anyone know where I can get it?
On Slashdot at the top left of the page is a menu, the second item on
the menu is "code", try clicking on that.
John
------------------------------
Date: Sun, 17 Dec 2000 19:05:37 GMT
From: David Steuber <nospam@david-steuber.com>
Subject: Ramblings (was Re: Language evolution C->Perl->C++->Java->Python (Is Python the ULTIMATE of languages??))
Message-Id: <m3g0jmrhq7.fsf_-_@solo.david-steuber.com>
"bowman" <bowman@montana.com> writes:
' David Steuber <nospam@david-steuber.com> wrote in message
' >
' > Senile dimentia is a terrible thing. If Python is so great, why is it
' > written in C, a language which is alleged to have mistakes in it?
'
' because CPython is a hell of a lot faster than JPython.....
I bet it is. I also bet you have read John Ross's book ;-)
Back on topic of the flaim bait, I can't imagine any language being
the "ULTIMATE" of languages. Particularly Python. I took a look at
that language about six months or so ago. I didn't like the use of
white space for code structure. I just couldn't get past that. I'm
also not clear that Python really offered me anything that tcl or perl
did not.
One point I will agree on is that for many applications, a very high
level language is desirable simply because the total line count of the
program is reduced. Perl seems to do quite well in this area.
Using object orientation as a justification for the perfection of a
language is just plain silly. OO has its place. But it is not the
end of the rainbow.
There are also many things Python (or other very high level languages)
are simply not suited to do. I wouldn't write a compiler in any of
them. Well, I might, but not for industrial use. I certainly
wouldn't write an operating system in one. Even C is not low enough
level to write an operating system in without resorting to some
architecture specific assembler. Or has someone written a working
operating system that works from boot up without resorting to any
assembler at all?
I'm sure that as a matter of taste, Python will appeal to many
people. I am just not one of them. As ugly as Perl can look, I kind
of like it. I have found it to be useful.
If you look at the original post, it comes across as ravings.
There is another thread which I have found more interesting, and
disturbing, on Perl being replaced by Java. There seems to be some
notion that any non industry owned language is not suitable and that
Java is always going to be better than Perl.
There is a trend towards certifications and standardization that may
be harmful in the long run. I've got a nice URL that is a bit off
topic but is on the point:
http://heather.cs.ucdavis.edu/itaa.real.html
I am guessing that Python will never replace Perl, Tcl or Java. I
think that Java may cut into Perl though. Sun has a certification
program for Java programmers. Are there any industry accepted
standards for Perl, Python, or Tcl programmers? Are there any
industry certifications for any free software?
I think industry is feeling threatened by free software and is
reacting to that threat. The one thing that free software does not
have is marketing aimed directly at CTOs and other management types
who finally call the shots on what gets used. It seems that people
really want to spend more money on tools and less on talent.
--
David Steuber | Perl apprentice. The axe did not stop the
NRA Member | mops and buckets from flooding my home.
ICQ# 91465842
*** http://www.david-steuber.com/ ***
------------------------------
Date: Sun, 17 Dec 2000 15:44:31 GMT
From: pontz@NO_SPAM.channel1.com (Brian Pontz)
Subject: Re: Sendmail script problems
Message-Id: <3a3cdde9.310053512@news.ne.mediaone.net>
>print "Content-type: text/html\n\n";
^ Why this? ^ This is for printing HTML
>open (MAIL, "|/usr/bin/sendmail -t") || &MailError;
^ Might be |/usr/sbin/sendmail -t ^ At least the servers I've worked
on it is
>print MAIL "To: $email\nFrom: Industrial Network Solutions\n";
>print MAIL "Subject: Trial Version Industrial SNMP Suite\n";
>print MAIL "Here is the code: 1234\n";
>
>close (MAIL);
>
Other than that it works ok.
Brian Pontz
comp.lang.perl.misc Searchable archive
http://www.axehind.com/complangperl.html
comp.lang.c Searchable archive
http://www.axehind.com/complangc.html
------------------------------
Date: Sun, 17 Dec 2000 15:10:13 -0600
From: "Hawk" <someguyREMOVE@REMOVEsunflower.com>
Subject: Splitting data into an array
Message-Id: <t3qb00h0srv3fe@corp.supernews.com>
Hello,
I have a flat text database that has many lines like this
12-15-00
entry1
entry2
entry3
entry4
12-15-00 END
12-16-00
entry1
entry2
12-16-00 END
and so on.
Say I want to take all of the data between 12-15-00 and 12-15-00 END and
print it, how would I accomplish that?
Thanks in advance!
------------------------------
Date: Sun, 17 Dec 2000 21:41:37 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Splitting data into an array
Message-Id: <x7ofyag1ym.fsf@home.sysarch.com>
>>>>> "H" == Hawk <someguyREMOVE@REMOVEsunflower.com> writes:
H> Hello,
H> I have a flat text database that has many lines like this
H> 12-15-00
H> entry1
H> entry2
H> entry3
H> entry4
H> 12-15-00 END
H> 12-16-00
H> entry1
H> entry2
H> 12-16-00 END
H> and so on.
H> Say I want to take all of the data between 12-15-00 and 12-15-00 END and
H> print it, how would I accomplish that?
perl -ne 'print if /^12-15-00$/ .. /^12-15-00 END$/' file
uri
--
Uri Guttman --------- uri@sysarch.com ---------- http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page ----------- http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net ---------- http://www.northernlight.com
------------------------------
Date: Sun, 17 Dec 2000 23:58:24 +0100
From: "RJHM van den Bergh" <rvdb@comweb.nl>
Subject: SSI and cookies
Message-Id: <977093933.18916.0.pluto.c29fe22b@news.demon.nl>
Hello,
I'm trying to set a cookie from SSI.
The object is to make a web counter that only increases on new visitors.
The cookie must only be a session cookie
I've been fighting with the cookies in the past and know that they are very
error sensitive.
I added this at the FIRST line of my perl script
print "Set-Cookie: visitor=123; path=/; 0; \n";
and also tried these
print "Set-Cookie: visitor=123; path=.; 0; \n";
print "Set-Cookie: visitor=123; path=/; \n";
and several more combinations.
I experimented with this at the html page.
<META HTTP-EQUIV="Set-Cookie" CONTENT="visitor=123; path=/">
Indeed this sets the session cookie.
With the META HTTP-QUIV the SSI the first time doesn't see the cookie
but the second time it is set.
So the weird thing is "THE COOKIE IS SET AFTER THE PAGE HAS LOADED"
Or this is a timing bug at the browser.
So to say it in other words you don't know when the cookie is set.
You only know that it is going to be set.
It IS NOT possible to set a cookie with SSI
When I call the perl script directly it sets the cookie.
When I use SSI the perl script doesn't set the cookie.
So the conclusion is that the SSI does not cause an additional HTTP GET
First the html page is requested by the browser.
Then the server parses the SSI
and after that the page is sent to the browser.
All happens in ONE http GET.
To be sure I put this on a newsgroup.
Could someone confirm this ?
----------------
My biggest concern is that the cookie isn't set immediately
So it will not work for someone coming from the other site of the world.
For this person the cookie will be set before the SSI is processed.
Well COOKIES are just some buggy stuff.
Or am I thinking the wrong way.
An example of an Perl that works with SSI could be usefull.
Rob,
rvdb@comweb.nl
So my conclusion is simple.
You can't set a cookie with SSI.
Because the SSI is executed after the html page headers are sent.
It browser doesn't do a separate http request for the SSI.
Because of a browsers timing problem.
The cookie is stored after the page is loaded.
------------------------------
Date: 17 Dec 2000 19:24:27 GMT
From: peter.schuller@infidyne.com (Peter Schuller)
Subject: Re: Use PERL or Java? Which is faster?
Message-Id: <91j3tb$ds$5@hecate.umd.edu>
>>Are you talking about perl CGI scrpts versus servlets or something?
>>
>>That is NOT an accurate measurement of language speed.
>
>Servlets have the speed advantage. If Java is STILL 1/3rd the speed of
>Perl...
Invoking a servlet is more than just "theServlet.doGet(...)". The container
needs to do session handling and stuff too.
And have you tried Resin? It's quite fast. Although I have to agree that why
servlet containers aren't faster than they are is somewhat of a mystery.
In general, servlets seem to have a bit more initial overhead than perl
script. In current implementations.
In either way, you cannot conclude that Java is slower because your "hello
world" perl script could get executed faster than the equivalent servlet on
whichever servlet container you chose to use.
>>>Java historically brings computers to their knees.
>>
>>This isn't history. This is today. I'm sure the first implementation of perl
>>was dog slow too.
>
>When Perl first came out, computers were much slower. If Perl's speed
>was acceptable then, it must be lightning fast on today's computers.
Obviously, I meant "slow" compared to other technologies. Like C.
>It's not unlikely that improvements have been made. Only MS succeeds in
>making the next version much slower than the previous one. ;-)
:)
--
/ Peter Schuller, InfiDyne Technologies HB
PGP userID: 0x5584BD98 or 'Peter Schuller <peter.schuller@infidyne.com>'
Key retrival: Send an E-Mail to getpgpkey@scode.infidyne.com
E-Mail: peter.schuller@infidyne.com Web: http://scode.infidyne.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 5136
**************************************