[9136] in Perl-Users-Digest
Perl-Users Digest, Issue: 2753 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu May 28 18:08:15 1998
Date: Thu, 28 May 98 15:00:30 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Thu, 28 May 1998 Volume: 8 Number: 2753
Today's topics:
Re: Advanced Perl Programming Book (Josh Kortbein)
Re: ARGV? (Mark-Jason Dominus)
Re: CGI's slow/Sol2.6/Perl5 (Greg Gallagher)
Re: Clearly define "free software" (Chris Nandor)
Re: Clearly define "free software" <tchrist@mox.perl.com>
Re: Copylefting manuals <barmar@bbnplanet.com>
Re: Copylefting manuals <barmar@bbnplanet.com>
Re: Copylefting manuals <barmar@bbnplanet.com>
Re: Copylefting manuals <barmar@bbnplanet.com>
Re: Creating and Using Sockets (Josh Kortbein)
Re: Do pack/unpack Know About Memory Alignment (Honza Pazdziora)
Re: Don't Know how to decrypt using PERL (Michael J Gebis)
Re: Don't Know how to decrypt using PERL <brianm@kodak.com>
Re: Don't Know how to decrypt using PERL <tchrist@mox.perl.com>
Re: Embedding Perl (Ken Fox)
Re: file size with perl and win NT (Vasile CALMATUI)
Re: file size with perl and win NT <rootbeer@teleport.com>
Re: Free Documentation (was: Re: GNU attacks on the ope (Greg Lindahl)
Re: hash keys order returned by keys() reproducible ? (Tom Rokicki)
Help: Perl forms duplicating input values <simsi@hotmail.com.nospam>
Re: Help: Perl forms duplicating input values <rootbeer@teleport.com>
Mouse book [was:Re: Advanced Perl Programming Book] (Peter Gradwell)
Re: new to OO Perl (John Porter)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 28 May 1998 14:26:03 -0600
From: kortbein@iastate.edu (Josh Kortbein)
Subject: Re: Advanced Perl Programming Book
Message-Id: <kortbein-2805981426030001@balto.dwx.com>
In article <6kjqes$k9s$1@sol.caps.maine.edu>, "Christopher R. Redinger"
<redinger@usm.maine.edu> wrote:
>Okay, I've searched the FAQ, I've read the groups, and I can't seem to find
>the answer to this FAQ (at least around here). We've got the "Camel Book,"
>we've got the "Llama Book," heck we've even got the "Hip Owls" book. The
>question of the month around here as been, what the heck is on the cover of
>Advanced Perl Programming by O'Reilly?? We've been calling it the "Puma
>Book." But, I'm not too sure about the accuracy of that one. Any ideas?
>
>Oh yeah, and shouldn't this be added to the FAQ? ;)
It's right in the colophon to the book, isn't it?
Josh
NP: Spiritualized, _Ladies and gentlemen we are floating in space_
------------------------------
Date: 28 May 1998 17:01:42 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: ARGV?
Message-Id: <6kkjbm$iaa$1@monet.op.net>
Keywords: Abidjan Annalen bivariate northbound
In article <eM5HbGni9GA.180@upnetnews02.moswest.msn.net>,
Ric Alcazar <alcazar@netcomp.net> wrote:
> I'm relatively new to perl and have a few questions maybe you could help
>me with. <ARGV>? What it is and how is it used?
ARGV is a filehandle which, when you read from it, you get data from
the files named on the command line, or from the standard input if
there are no command line arguments.
<ARGV> means to read a line from this input source.
Example:
while (1) {
$line = <ARGV>;
exit 0 unless defined($line); # End of input?
chomp $line;
$reversed = reverse $line;
print $reversed, "\n";
}
Let's call this program `rev'. It reads an input and prints out the
input, with each line reversed.
If you say
rev file1 file2 file3
it prints out all the lines from file1, file2, and file3, each reversed.
If you just say
rev
it reads from the standard input, probably the terminal.
You don't have to handle these cases explicitly, and you don't have to
explicitly write code to examine the arguments or to open the files
named in the arguments; <ARGV> does that automatically.
It is very unusual to use <ARGV>, because <> means the same thing, and
people usually use <> instead of <ARGV>.
> What is a minimalist script?
The example above is a minimalist script.
------------------------------
Date: 28 May 1998 15:32:54 GMT
From: ggallag@admiral.ls.luc.edu (Greg Gallagher)
Subject: Re: CGI's slow/Sol2.6/Perl5
Message-Id: <6kk036$g6l$1@artemis.it.luc.edu>
wkessler@my-dejanews.com wrote::
::Has anyone else experienced this? Does anyone have any suggestions? I've
::tried everything I can think of!
Nope, but why don't you look into getting Modperl from CPAN. That should
boot the performance significally , after you modify the scripts which are
draining the most resources.
Greg Gallagher <ggallag@luc.edu>
Loyola University, student
http://orion.it.luc.edu/~ggallag
------------------------------
Date: Thu, 28 May 1998 20:02:36 GMT
From: pudge@pobox.com (Chris Nandor)
Subject: Re: Clearly define "free software"
Message-Id: <pudge-2805981557010001@dynamic265.ply.adelphia.net>
In article <slrn6mr5nr.6tn.mdw@catbert.ebi.ac.uk>, mdw@ebi.ac.uk wrote:
# Chris Nandor <pudge@pobox.com> wrote:
#
# > The software does not dumb-down the users, it meets them at the level
# > they are already at. They are "dumb". They should be treated as
# > dumb.
#
# Forgive me if I get the wrong impression from this, but you appear to be
# saying, quite baldly, that users are idiots, and that it's all right to
# try to foist off substandard software on them because they're too stupid
# to tell the difference, and that this is the way it should be.
Who said anything about substandard? I am talking specifically about
making "dumb" software for "dumb" people. My point is, and you cannot
seem to grasp it (which is telling), is that says nothing about the
quality of the software.
A 3-year-old does not use Photoshop. He uses some Disney drawing game.
You can do very few things, and very little of the power of the software
is exposed. Does that mean the software is substandard, that it sucks?
Of course not. Most consumers cannot handle more complicated software, it
is not for them.
# > Guess what? This software that hides all this stuff may not be for
# > you. So what is wrong with that?
#
# What's wrong is that it's telling users that they're stupid, that this
# is all they can expect, that mediocrity is the rule, and that anything
# else is for nerds with boring conversation and poor personal hygiene.
I didn't say there is not room for improvement in offerings or
capabilities. An ideal situation would be several versions of a word
processor, or a word processor that can have several user levels set. One
user level for 5-year-olds, one for "dummies" (my dad), one for
experienced users (my mom), one for professionals.
# > I can't understand this "this software is too dumb for me, so it sucks
# > and no one should use it" mentality.
#
# Well, at least that's symmetrical. I can't understand the mentality
# which says that users are too stupid to use software which gets the job
# done
THEY ARE. Most (or at the least, very many) users have no clue. I am not
cynical, I am optimistic, but I am realistic as well.
# no frills or flourishes, but high quality results. I can't
# understand the mentality which says that everything must be usable by
# a user who's not bothered to read the manual.
Who said everything must be usable? That is the point. To people who
cannot handle using everything, only the minimum or a subset of everything
is provided.
# I despair of an industry which pretends that users can produce quality
# typesetting without knowing anything. I despair of an industry which
# pretends that cryptography implies security.
This has absolutely not one jot of anything to do with anything I have
said here. I did not once imply or state that these "dummies" can do high
quality things with the "dummy" software.
# > There is nothing wrong with "one-button Internet access". I wouldn't
# > use it for me, but I would have my dad use it.
#
# `One-button Internet access' is a myth. It doesn't exist.
That is why it is in quotes.
The bottom line is that it is unrealisitc and unnecessary to force
"dummies" to use software that will only get them into trouble. Software
for dummies must be made with the dummy in mind. I don't see why this is
hard to grasp. That does not mean that the software will be as good as
the professional software; it almost certainly will not be. And so what?
--
Chris Nandor mailto:pudge@pobox.com http://pudge.net/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10 1FF77F13 8180B6B6'])
------------------------------
Date: 28 May 1998 21:04:16 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Clearly define "free software"
Message-Id: <6kkjgg$o90$3@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
pudge@pobox.com (Chris Nandor) writes:
:Who said anything about substandard? I am talking specifically about
:making "dumb" software for "dumb" people.
You have to make software be for dumb people. In fact, it has to be
for *really* dumb people. The proof is obvious. If you made it for
those merely average people with their soaring brains, you'd lose 50%
of your market, and Mr $Bill would make very high-pitched keening noises
as his head popped off. Software must be written for Z=-3 to achieve
the desired 99.98% market saturation.
--tom
--
If you can stick your finger in it, you can hang from it. --Andrew Hume
------------------------------
Date: Thu, 28 May 1998 21:04:34 GMT
From: Barry Margolin <barmar@bbnplanet.com>
Subject: Re: Copylefting manuals
Message-Id: <Cjkb1.48$443.1394311@cam-news-reader1.bbnplanet.com>
In article <pudge-2805980950440001@dynamic265.ply.adelphia.net>,
Chris Nandor <pudge@pobox.com> wrote:
>I did not mean to imply that something is under patent without being
>registered (although people have gone back and patented things that have
>been in public use). I am just pointing out that if an example is
>modified, there is a good chance it won't be considered copyright
>infringement.
If the example is modified, the result is a derived work, and still covered
by the original author's copyright (as well as the modifier's copyright).
--
Barry Margolin, barmar@bbnplanet.com
GTE Internetworking, Powered by BBN, Cambridge, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
------------------------------
Date: Thu, 28 May 1998 21:10:09 GMT
From: Barry Margolin <barmar@bbnplanet.com>
Subject: Re: Copylefting manuals
Message-Id: <Rokb1.49$443.1394311@cam-news-reader1.bbnplanet.com>
In article <6kju89$mb3$1@Mercury.mcs.net>, Leslie Mikesell <les@MCS.COM> wrote:
>I don't understand why you would not want your code to be used as
>close to verbatim as possible. If people make arbitrary changes
>they are likely to screw it up, resulting in bad publicity about
>your code which isn't actually to blame. Unless, of course, you
>publish something without actually testing it first...
Perhaps the code, being just an example, doesn't solve the reader's precise
problem. Code being copied from manuals often needs to be adapted to the
new situation. Also, code in manuals is often skeletal and needs to be
fleshed out. The example writer might leave out some error checking, as
this often obscures the point that the example is trying to make.
I also don't expect "bad publicity" to result. If someone takes a couple
dozen lines of code from a manual and includes them in a program hundreds
or thousands of lines long, and there's a bug in the program, are you going
to blame the author of 1% or the author of the remaining 99%?
--
Barry Margolin, barmar@bbnplanet.com
GTE Internetworking, Powered by BBN, Cambridge, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
------------------------------
Date: Thu, 28 May 1998 21:15:29 GMT
From: Barry Margolin <barmar@bbnplanet.com>
Subject: Re: Copylefting manuals
Message-Id: <Rtkb1.50$443.1394311@cam-news-reader1.bbnplanet.com>
In article <6kk5tb$mtk$1@Venus.mcs.net>, Leslie Mikesell <les@MCS.COM> wrote:
>OK, let's go full circle back to fair use. If the purpose of the book
>is to present working examples of code and it is advertised as such,
>how can it be other than fair use to use them?
If the book specifically gives permission to copy the examples, then it's
obviously fair use to do so. But many manuals include examples for
explanatory purposes, to help you understand the prose, not to provide full
code to copy into your programs. In the absence of explicit permission, I
would assume the latter intent, and the 4 criteria of the Fair Use Test
would need to be applied.
--
Barry Margolin, barmar@bbnplanet.com
GTE Internetworking, Powered by BBN, Cambridge, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
------------------------------
Date: Thu, 28 May 1998 21:24:36 GMT
From: Barry Margolin <barmar@bbnplanet.com>
Subject: Re: Copylefting manuals
Message-Id: <oCkb1.51$443.1394311@cam-news-reader1.bbnplanet.com>
In article <6kjtuu$m98$1@Mercury.mcs.net>, Leslie Mikesell <les@MCS.COM> wrote:
>Are you suggesting that if we purchase a book specifically for the
>purpose of learning the *exact* technique for some procedure
>we are then prohibited from using it?
It's the author's prerogative. Your intention in buying the book may not
match his intention in publishing it.
For instance, I could write a proprietary OS, and then publish a book on
operating system design, using excerpts from my OS in examples. The
purpose of these examples would be to show concrete examples of the
abstract concepts described in the text, not to provide working code so
someone could reimplement my OS. If you bought the book with that in mind,
you made a mistake.
>
>>Brad Templeton's Copyright Myths FAQ has this to say about fair use:
>>
>> Fair use is a complex doctrine meant to allow certain valuable
>> social purposes. Ask yourself why you are republishing what
>> you are posting and why you couldn't have just rewritten it
>> in your own words.
>
>Rewriting a program chunk means you have to test everything again and
>there is no reason to expect it to work. After all, if you knew how
>to do it yourself you wouldn't have bought the book. There is certainly
>value in using previously tested code.
Certainly. But that doesn't mean that it falls under the fair use
exception in copyright law. If you want to use someone else's code in your
program, you normally need to get his permission. That the code is in a
manual rather than another program doesn't necessarily change this.
However, I'm not a legal scholar, so I don't know precisely how the fair
use doctrine would apply. That's why I hoped for an IP lawyer to supply
some insight (I don't know how many of them hang out in this newsgroup -- I
could probably get an answer if I added misc.int-property to the
cross-posting, but I'm loathe to expand this moby thread to an
unsuspecting, innocent newsgroup like that).
--
Barry Margolin, barmar@bbnplanet.com
GTE Internetworking, Powered by BBN, Cambridge, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
------------------------------
Date: Thu, 28 May 1998 14:24:33 -0600
From: kortbein@iastate.edu (Josh Kortbein)
Subject: Re: Creating and Using Sockets
Message-Id: <kortbein-2805981424340001@balto.dwx.com>
In article <6kioth$r32$1@comdyn.comdyn.com.au>, mgjv@comdyn.com.au
(Martien Verbruggen) wrote:
>In article <356CCBE0.90A46FB4@hub.ofthe.net>,
> Drew Wiggins <collier@hub.ofthe.net> writes:
>> I am attempting to write a PERL script that acts somewhat like a
>> spider. Rather than jumping from link to link, however, it just needs
>> to return the contents of a single public file on a remote web server.
>> My experience with sockets is limited to Windows, and I would like some
>> references for some in depth materials on Unix, or any advice anyone
>> might have.
>
>Rather than trying to implement all the socket functionality yourself,
>you might want to give the libwww package a try. It has many modules
>and tools that facilitate the client side of Web stuff.
>
>http://www.perl.com/CPAN/modules/by-module/LWP/
... but if you're shooting for the fun of playing with sockets yourself
then the sockets example in the Camel book is a great intro.
Josh
NP: Spiritualized, _Ladies and gentlemen we are floating in space_
------------------------------
Date: Thu, 28 May 1998 21:06:49 GMT
From: adelton@fi.muni.cz (Honza Pazdziora)
Subject: Re: Do pack/unpack Know About Memory Alignment
Message-Id: <adelton.896389609@aisa.fi.muni.cz>
james.p.williams@usahq.unitedspacealliance.com writes:
> It would be really great if I could write a perl module that can replace
> the GUI. How can I fill the structs when sending and access fields from
> them when receiving? The only solutions I know of are:
>
> 1) Use pack/unpack. Do these functions know how to pad to satisfy
> memory alignment restrictions?
I hope not. With pack/unpack, you have a precise tool to position you
data inside of your strings. By definition, it cannot know about the
alignment: with different compilers, you get different results, as you
get with the same compiler on 386 and for example Pentium. I believe
that the alignment is very much dependent on the compiler and the
options you pass it.
> 2) Write C++ code with a perl wrapper.
That is a way to go, probably better. If you are able to preserve the
compiling flags of maybe only write Perl wrapper around the object
file, that will work.
> Is there a better way?
You can do it by hand -- if you know for sure what the process on the
other end expects, you can always build up the data using pack with @.
Hope this helps,
--
------------------------------------------------------------------------
Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
I can take or leave it if I please
------------------------------------------------------------------------
------------------------------
Date: 28 May 1998 19:56:50 GMT
From: gebis@albrecht.ecn.purdue.edu (Michael J Gebis)
Subject: Re: Don't Know how to decrypt using PERL
Message-Id: <6kkfi2$ij1@mozo.cc.purdue.edu>
"Larry Rosler" <lr@hpl.hp.com> writes:
}brian d foy wrote in message ...
}>In article <1d9plpi.cto6hok4lup8N@slip166-72-108-10.ny.us.ibm.net>,
}kpreid@ibm.net (Kevin Reid) posted:
}>>Kevin Buhr <buhr@stat.wisc.edu> wrote:
}>>> > result = crypt(plaintext , salt) ;
}>>What is the purpose of the salt?
}>
}>see the man page for crypt(3) which (definatively) explains all of
}this.
}I sympathise with those who answer questions here by RTFM or RTFFAQ or
}even point to DejaNews (provided they provide suitable pointers for how
}to do so). But I am astounded by an answer that says RTF Unix manual!
}As far as I know, that is neither part of any Perl distribution nor
}available on line (if so, where is the suitable pointer in your
}response?).
Security a tricky subject, where it is easy for a small mistake
to cause a big problem. It's the sort of place where you want to get
your information from an authoritative source. I agree that a lot of
times, questions on this group are too often answered in a unix-centric
way, but I think that in this case, it was not such a bad thing.
--
Mike Gebis gebis@ecn.purdue.edu mgebis@eternal.net
------------------------------
Date: Thu, 28 May 1998 16:53:57 -0400
From: Brian Mathis <brianm@kodak.com>
Subject: Re: Don't Know how to decrypt using PERL
Message-Id: <356DCEE5.A514A2A7@kodak.com>
Larry Rosler wrote:
> <RANT ON>
>
> I sympathise with those who answer questions here by RTFM or RTFFAQ or
> even point to DejaNews (provided they provide suitable pointers for how
> to do so). But I am astounded by an answer that says RTF Unix manual!
> As far as I know, that is neither part of any Perl distribution nor
> available on line (if so, where is the suitable pointer in your
> response?).
[...]
> --
> Larry Rosler
What is typically referred to as "the man pages" can also be found, identically,
in perldoc format. Perl is distributed with man pages as well as pod
documentation (man pages are in /usr/local/man/man1, but most UNIX installations
are braindead to the entire /usr/local/man hierarchy). Many times, saying "man
pages" simply means "documentation", but "man" is easier to type. It also
implies that the use should be using UNIX, because *everyone* should be using
UNIX.. :)
Regaurdless of what format the information is in, the point that is made is
"read the documantation, most of what you need to know is in there".
Brian Mathis
--
$_="
,.,,,.,,.,,.,,,,..,,,,,,,,.,,,,,,,,,,,,,,,,,,,,,,,.,,,,,,,..,..,,.,,,,,,,,,
";s/\s//gs; tr/,./05/; @a=split(//); $_=<DATA>; tr/~`'"^/0-4/;map{$o.=
$a[$i]+$_;$i++} split(//); map{$o[++$#o]=substr($o,$j,3);$j+=3}@a;map{
print chr($_)}@o; __DATA__ # Brian Mathis, Just another perl hacker.
~'^``'``~```~"'~^'``~```````~^`~```^~"'``'`~```^`~"~"'`~^~^'~^^`~'`~```^~`~
------------------------------
Date: 28 May 1998 20:58:49 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Don't Know how to decrypt using PERL
Message-Id: <6kkj69$o90$2@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
"Larry Rosler" <lr@hpl.hp.com> writes:
:I sympathise with those who answer questions here by RTFM or RTFFAQ or
:even point to DejaNews (provided they provide suitable pointers for how
:to do so). But I am astounded by an answer that says RTF Unix manual!
I'm sorry this should bother you, but we cannot teach the
full C library that Perl has access to. What a horrible burden.
--tom
--
Let me put it to you this way: computers are my business. --Andrew Hume
------------------------------
Date: 28 May 1998 20:24:49 GMT
From: kfox@pt0204.pto.ford.com (Ken Fox)
Subject: Re: Embedding Perl
Message-Id: <6kkh6h$k4h3@eccws1.dearborn.ford.com>
bavo@ace.ulyssis.student.kuleuven.ac.be (Bavo De Ridder) writes:
> I want to embed the interpreter in my program *and* have the perl
> code call some functions of my C++ program.
If you're using SWIG, you'll have blessed references to your C++
objects. If you want to dispatch through Perl, use the function
perl_call_method. If you know the type of object, i.e. you don't
need Perl's dynamic dispatch, then you can just extract the real
object pointer from the Perl object and use a normal C++ method
call. It's obviously safer to use the Perl dispatch, but it is
a *lot* faster to just use a C++ method call.
- Ken
--
Ken Fox (kfox@ford.com) | My opinions or statements do
| not represent those of, nor are
Ford Motor Company, Powertrain | endorsed by, Ford Motor Company.
Analytical Powertrain Methods Department |
Software Development Section | "Is this some sort of trick
| question or what?" -- Calvin
------------------------------
Date: Thu, 28 May 1998 20:22:50 GMT
From: vasile@club-internet.fr (Vasile CALMATUI)
Subject: Re: file size with perl and win NT
Message-Id: <356dbe6c.6901938@news.club-internet.fr>
Scott Sutherland <suthsc@ncs.com> wrote:
>> It is a file made by the a mail reader program (Eudora Light).
>> It's composed of text mails separated by 2-3 binary caracters.
>> But why binary caracters can make life hard to Perl on Win32 ?
>>
>
>Beacuse MS-DOS makes a distinction between binary files and text
>files.
>perldoc -f binmode
>Another thing that you have to watch out for is C-z characters in text
>files. C-z used to delimit EOF for DOS, and it still hangs around in
>some programs/libraries.
Thanks folks !
It worked fine using binmode(). Poor Win32 :-)
It should be marked somewhere in the FAQs. No ?
- -
Vasile Calmatui
vasile@club-internet.fr
http://www.chez.com/vasile/
------------------------------
Date: Thu, 28 May 1998 20:41:40 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: file size with perl and win NT
Message-Id: <Pine.GSO.3.96.980528134012.29051f-100000@user2.teleport.com>
On Thu, 28 May 1998, Vasile CALMATUI wrote:
> It worked fine using binmode(). Poor Win32 :-)
>
> It should be marked somewhere in the FAQs. No ?
Yes. Section four of the FAQ has this.
How do I handle binary data correctly?
Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 28 May 1998 20:27:40 GMT
From: lindahl@pbm.com (Greg Lindahl)
Subject: Re: Free Documentation (was: Re: GNU attacks on the open software community)
Message-Id: <6kkhbs$pph@news3.newsguy.com>
Christopher Eltschka <celtschk@physik.tu-muenchen.de> writes:
> > I know that's very anti-FSF of me to give something away so freely without
> > strings, but it's what I want to do. I think that's what Perl wants to do.
>
> No, it's very anti-FSF that you attach certain strings to the
> rest of the document, namely denying the right to change it, and
> denying the right to make profit from it. (Note that they don't
> have any problem with your right to be identified as author of it).
Woah. Don't let Tom talk you into thinking that the world is either
pro or anti-FSF. Who cares if Tom does or doesn't do what the FSF
likes? I sure don't. Nor do I care about Tom's complaint that the FSF
doesn't think Tom's documentation is perfect for FSF purposes.
Different people, different goals, no problem [ except for Tom
starting cross-posted flamewars about it, but hey, if he thinks that's
good for his career, who's to say no? ]
-- g
------------------------------
Date: 28 May 1998 14:02:38 -0700
From: rokicki@cello.hpl.hp.com (Tom Rokicki)
Subject: Re: hash keys order returned by keys() reproducible ?
Message-Id: <6kkjde$blm@cello.hpl.hp.com>
> Bruno LACROIX <blacroix@soleil.biomerieux.fr> wrote:
> >First, I've always believed that the order in which a hash's keys are
> >returned by keys() is identical as long as the hash itself is the same;
As long as it is the same hash, not as long as the hash has the same
contents. Two different (but otherwise identical) hashes may return
them in a different order.
Indeed, the assignment
%c = %a
will probably set up the hashes so they return keys in a different order!
(In Perl 5.004_04, it apparently reverses the order of the bucket chains.)
perl -de 1
Loading DB routines from perl5db.pl version 1.01
Emacs support available.
Enter h or `h h' for help.
main::(-e:1): 1
DB<1> %a = (ab => 1, ba => 2)
DB<2> %b = (ba => 2, ab => 1)
DB<3> p join ' ', keys %a
ba ab
DB<4> p join ' ', keys %b
ab ba
DB<5> %c = %a
DB<6> p join ' ', keys %c
ab ba
-tom
$g=join'',map{chr rand 2}a..wls;for($q=201;print'-'x79;$g=($f^($w=($z=$m.$e)^
substr$e,$q)^($n=$b^$d|$a^$l))&($w|$z^$f^$n)&($l|$g)){for$y(1..20){$_=substr$g
,$y*$q+6060,79;tr/\0\1/ X/;print"$_\n"}$c=($d=($a=substr$g,1)^($b=0 .$g))^$g;
$e=($f=$a&$b)|$d&$g;$l=substr$d^($a=($b=($m="\0"x$q).$c)^substr$c,$q),0,15879}
------------------------------
Date: 28 May 1998 21:05:20 GMT
From: "Simmo" <simsi@hotmail.com.nospam>
Subject: Help: Perl forms duplicating input values
Message-Id: <01bd89b2$def19440$68c348c2@is>
Hi,
Can anyone help with this Perl problem. I'm using Win32 Perl (latest) and
am
flipping between forms on different pages but when i return to a form on a
page for the third time and above, the value (which i am trying to keep
visible) duplicates.
For example: I goto page 1, fill in my name as Ian, click a button to go to
page 2,
fill in my address as 'at home', go back to page 1, do nothing, goto page 2
and the value is still shown as 'at home'. Fine. I go back to page 1 then
to page
2 and the value is now 'at homeat home'. This carries on getting bigger and
bigger. Incidentally, the same thing happens under Unix.
any ideas? Help gratefully received.
Many thanks
Ian Sims
Reply via this group or to:
simsi@hotmail.com
------------------------------
Date: Thu, 28 May 1998 21:29:20 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Help: Perl forms duplicating input values
Message-Id: <Pine.GSO.3.96.980528142705.29051k-100000@user2.teleport.com>
On 28 May 1998, Simmo wrote:
> I'm using Win32 Perl (latest) and am flipping between forms on different
> pages but when i return to a form on a page for the third time and
> above, the value (which i am trying to keep visible) duplicates.
That sounds as if there's a bug in your software. Cut your code down to as
small an example as possible which shows the buggy behavior. Ideally,
this should be one statement which isn't doing what you think it should.
If you still don't see what's wrong after checking the docs again, please
post your example here. Good luck!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Thu, 28 May 1998 21:09:50 +0100
From: pjg7@aber.ac.uk (Peter Gradwell)
Subject: Mouse book [was:Re: Advanced Perl Programming Book]
Message-Id: <pjg7-2805982109510001@pcihhh.ott.aber.ac.uk>
In article <6kk7qs$7rq@nntp02.primenet.com>, coyotl@primenet.com (Glen G.
Walker) wrote:
>I would be interested in hearing what people think of the "Mouse Book"
>(CGI Programming). As a complete PERL beginner, I am finding it a big
>help, but everybody else I talk to thinks that it is useless.
>
As an introductory book on cgi programming it was good, but I learn't just
as much from reading other people's cgis and a copy of Learning Perl.
It does have a few good tips though.
Peter.
--
peter at gradwell dot com
mailto:peter[@]gradwell.com online @ http://www.gradwell.nu/
"To look back all the time is boring. Excitement lies in tomorrow"
...have you seen www.aber.nu? - It'll be a "nu" aber web site.
------------------------------
Date: Thu, 28 May 1998 20:40:37 GMT
From: jdporter@min.net (John Porter)
Subject: Re: new to OO Perl
Message-Id: <MPG.fd7979714d631e19896fc@news.min.net>
On Thu, 28 May 1998 11:00:08 -0700,
in article <6kk8no$778@hplntx.hpl.hp.com>,
lr@hpl.hp.com (Larry Rosler) wrote:
>
> Is it OO that makes the difference here, or simply the protection of
> namespaces afforded in Perl by packages? Large valuable subroutine
> libraries have been available for decades. Does calling the
> abstractions that they encapsulate "classes" add value comparable to the
> extra overhead?
1. Calling the abstractions encapsulated by a subroutine library
"classes" adds no overhead. It's also not conformant to any
generally accepted definition of OO. Overhead comes from dynamic
binding; and you only get that when both a) your language supports it,
and b) you code to take advantage of it. Although, I suppose, now
that it's 1998, there may be libraries of classes which have been
around for 20 years. In Smalltalk maybe.
2. We're talking about Perl OO, of course; the fact that many OO
purists would not consider Perl's to be true OO is not to the point.
So in fact, protection of namespaces should be a minimal concern:
the main thing in a namespace you care about is the subs, anyway.
Any vars it the namespace are "class static", so they are probably
minimized in a decent implementation. OTOH, I guess any object
is its own little namespace (if it's a hash, anyway), so in that
sense you don't get protection.
Rather, I'm talking about the benefits of abstraction and
inheritance.
> >According to my benchmarks, sub calls are much slower than
> >hash lookups. So, if speed is important, then one should avoid
> >writing code that uses subroutines. Makes sense, right?
>
> It all depends. Inlining is a way of avoiding using subroutines,
> essentially by "cut and paste". It's nice when a good optimizer does it
> for you, but sometimes you just have to do it yourself.
Great. But whatever reasonings you apply to speed up function calls,
or to apologize for them being slow, the same apply to OO, in
Perl at least, inasmuch as you have to access objs via sub calls,
if you do nothing else OO. See the benchmark below.
> I *am* trying to focus on
> the cost/benefit tradeoffs of OO per se (which could apply to C++ versus
> C, also).
One source of additional overhead is in dynamic resolution of
methods.
Here's a benchmark which determines the overhead associated with
method lookup. (This assumes that the sub is found to belong to
the first package tried.)
use Benchmark;
sub Foo::lookup { my $self = shift; $self->{'key'} }
$o = bless { 'key' => 'val' }, 'Foo';
timethese( 500_000, {
'hashlook' => sub { $o->{'key'} },
'funccall' => sub { Foo::lookup($o) },
'methcall' => sub { $o->lookup() },
'nullcall' => sub { },
});
Normalized:
hashlook: 10.94
funccall: 46.53
methcall: 56.53
As you can see, the big hit comes from using function calls of
even the normal kind. Going to method lookup adds a 21%
performance hit. Put another way, if one uses methods, then
about 80% of the time is spent on the function call, and 20%
on the method lookup. ('Course, this is the best case. Each
miss on the lookup adds more time.)
John Porter
(And please let's not forget that the originator of this thread
was seeking help in doing Perl OO correctly. He wasn't asking
for advice on how to solve his problem in the fastest possible way.)
------------------------------
Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
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.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
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 V8 Issue 2753
**************************************