[9132] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 2750 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu May 28 14:07:35 1998

Date: Thu, 28 May 98 11:00:42 -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: 2750

Today's topics:
    Re: "ref($proto) || $proto" considered harmful (was Re: <tchrist@mox.perl.com>
    Re: "ref($proto) || $proto" considered harmful (was Re: <tchrist@mox.perl.com>
    Re: 'insecure dependency in _____ when using setuid' in <rootbeer@teleport.com>
    Re: Advanced Perl Programming Book <brianm@kodak.com>
    Re: Advanced Perl Programming Book (Glen G. Walker)
    Re: Clearly define "free software" (Mark Wooding)
    Re: Copylefting manuals (Leslie Mikesell)
    Re: Don't Know how to decrypt using PERL (Mark-Jason Dominus)
    Re: Email address checker - comments welcome <rootbeer@teleport.com>
    Re: Getting rid of carriage returns pinetree@my-dejanews.com
    Re: GPL documentation == unspeakable evil <celtschk@physik.tu-muenchen.de>
    Re: Have we got a good free Perl manual? <hp@pobox.com>
    Re: Have we got a good free Perl manual? <hp@pobox.com>
    Re: Need Perl Expert: how to identify Perl reserved wor <aqumsieh@matrox.com>
    Re: new to OO Perl (John Porter)
    Re: Page redirection slide show (Honza Pazdziora)
    Re: perl5 <=> perl4 incompatibility ? <rootbeer@teleport.com>
    Re: Reading whole file into a scalar (Mick Farmer)
    Re: Statistics for comp.lang.perl.misc (Jeff Yoak)
    Re: using 'read' in a CGI script ? <rootbeer@teleport.com>
    Re: Using Perl 5 with Frontpage and Personal Web Server <rootbeer@teleport.com>
    Re: Visibility of "my" vars (Honza Pazdziora)
    Re: Wanted: info on passing args to functions in perl5 <Dave.Cross@gb.swissbank.com>
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: 28 May 1998 16:50:11 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: "ref($proto) || $proto" considered harmful (was Re: OO - explicit package name required)
Message-Id: <6kk4k3$2tg$2@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, 
    Randal Schwartz <merlyn@stonehenge.com> writes:
:For instance
:cloning, create a different method called "clone" or "copy", or just
:call:
:
:	(ref $instance)->new(@parms)
:
:to invoke the class method again.

No, that's wrong.  The method didn't get the original object
pointer, which it might need.  And whether it needs it really
isn't your business.

--tom
-- 
     This is UNIX; if you can't get the sources, it isn't freeware.
     --Peter Salus


------------------------------

Date: 28 May 1998 17:03:53 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: "ref($proto) || $proto" considered harmful (was Re: OO - explicit package name required)
Message-Id: <6kk5dp$2tg$5@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, 
    Zenin <zenin@bawdycaste.org> writes:
:	Err, huh?  Why would this ever be a problem?  Under what
:	conditions?  At least to me, it makes perfect sense
:	that:
:		$anotherLego = $lego->new();
:

Of course it does.   Many people, including you, me, and mjd,
have all come up with this on their own.  It is elegant and clean.
Randal's background is showing.  Don't be too rough on him -- unless
he tells you you're wrong. :-)

--tom
-- 
    "The usability of a computer language is inversely proportional to the
    number of theoretical axes the language designer tries to grind."
    	--Larry Wall


------------------------------

Date: Thu, 28 May 1998 17:28:07 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: 'insecure dependency in _____ when using setuid' in HP/UX 10.2
Message-Id: <Pine.GSO.3.96.980528102628.29051H-100000@user2.teleport.com>

On Wed, 27 May 1998, Scott wrote:

> Subject: 'insecure dependency in _____ when using setuid' in HP/UX 10.2

Have you seen what perldiag and perlsec have to say about this?

> Is there a "clean" way to get my script to work without wrapping it?  I
> can't
> set the setuid bit on the script because it is not allowed in the kernel,
> and
> I don't feel like putting in a security hole.

You're right; wrapping it could be a security hole. But perlsec explains
how to deal with this. Hope this helps!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



------------------------------

Date: Thu, 28 May 1998 13:26:07 -0400
From: Brian Mathis <brianm@kodak.com>
Subject: Re: Advanced Perl Programming Book
Message-Id: <356D9E2F.587E45CA@kodak.com>

Tom Christiansen wrote:
> It's actually a black leopard, and we all call it the ``Panther Book''.
> The word panther denotes any large cat, usually in its darker color morph.
> A mountain lion, a leopard, or a jaguar could all be black panthers.
> 
>     http://work.ucsd.edu:5141/cgi-bin/http_webster?panther
> 
> --tom

I thought it was the "Retarded Bear" ?

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 10:45:00 -0700
From: coyotl@primenet.com (Glen G. Walker)
Subject: Re: Advanced Perl Programming Book
Message-Id: <6kk7qs$7rq@nntp02.primenet.com>
Keywords: Assorted Lizard Parts

In article <356D7DFA.63FC4F6E@gpu.srv.ualberta.ca>,
Andrew Johnson  <ajohnson@gpu.srv.ualberta.ca> wrote:
>Christopher R. Redinger 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?

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.




--
-------------------------------------------------------------------------------
Glen G. Walker,  coyotl@primenet.com
www.primenet.com/~coyotl	
-------------------------------------------------------------------------------


------------------------------

Date: 28 May 1998 16:55:23 GMT
From: mdw@catbert.ebi.ac.uk (Mark Wooding)
Subject: Re: Clearly define "free software"
Message-Id: <slrn6mr5nr.6tn.mdw@catbert.ebi.ac.uk>


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.

Does that strike anyone else as chillingly cynical?

> Get used to it.  Unless everyone in the world become professional
> computer users, this is not going to change.  I don't need to know how
> my engine works to drive my car.

Oh, this analogy again.  It's actually not a bad one.

To drive a car well, you have to understand how it works.  You have to
know how to maintain it.  You have to understand about tyre grip, and
how to control a car well when there's not much grip.  You need to know
your car's performance limits: how well it accelerates and brakes, how
well it goes around corners.  

You can drive a car without knowing these things.  But you can't do
anything fancy with it.  It'll get you where you want to be, but you'll
do it slowly, and you'll annoy the people who can't get past you.

But there's something about real ignorance of cars which isn't like
ignorance of computers.  If you see someone trying to top up the oil in
a car's engine through the dipstick hole, you laugh at them and think
they're stupid.  It's something that everyone knows is silly.  But
ignorance of computers doesn't seem to be something to ridicule.  It's
something to be proud of, to flaunt; it's cool to be a `dummy', it's
fashionable to be clueless.  Why?

And there are other differences.

Driving a car is a demanding job.  There's a whole load of things you
have to know about, to look out for, to control, even if you're only
driving slowly.  It's probably one of the most difficult things most
people in the developed world do.  You have to spend a long time
learning to become good enough to be given a licence, and you have to
take a test to prove that you're safe and capable of controlling a car.

`Driving' a computer is something people seem to expect should be made
easy for them.  Why?  Because they believe the hype they see.  But it's
not all simple.  There are abstractions to understand, even in Austin's
`consumer-grade' software.  There are concepts to learn.  And it's hard,
yes, but it's not impossible.  But because the hype says it's easy,
people think they're stupid, and they buy books which tell them they're
stupid.  They're not, but they believe it anyway.  And the hype says
Unix is hard, and that's wrong too.

But deep down, the story is the same.  Driving cars is being dumbed down
too.  And that's even scarier.  New cars have airbags, and antilock
brakes, and traction control.  The hype says the car is safe, so you can
drive it badly and it won't matter.  But the hype's wrong.  The antilock
brakes don't decrease stopping distance[1].  The airbags won't help the
guy in the other car.

> I am glad that I have computers inside it telling me what is right and
> wrong and what to do.  And I don't want to have to assemble the engine
> before I start driving it.

You don't have to assemble the engine of a new car, but it still helps
if you break it in gently: no hard acceleration or high revving for the
first few thousand miles.  I can install a Linux installation very
easily, but a little effort configuring it immediately afterwards pays
dividends.

> 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 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; 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.

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.

These things tell me there's something rotten in the software
development industry as it is today.  It's something I don't want to be
a part of, and it's something I want to see gone, and the sooner the
better.

> 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.  OK, you can
make the dial-up process relatively simple, once you know what sort of
modem the client has, but it's still not quite `one-button'.  And once
you've got your PPP link, then the fun starts.

The Web is not the same as the Internet, no matter what Microsoft's
slick icons and their four-colour glossy brochures might say.  It's
complicated out there, and nothing's making it any simpler.


[1] Actually, with good modern tyres, and in dry road conditions,
    minimum braking distance is achieved by locking all four wheels.
    [Information from the UK Insitute of Advanced Motorists.]
-- 
[mdw]

`Don't be too proud of this technological terror you've constructed.'
		-- Darth Vader


------------------------------

Date: 28 May 1998 12:12:11 -0500
From: les@MCS.COM (Leslie Mikesell)
Subject: Re: Copylefting manuals
Message-Id: <6kk5tb$mtk$1@Venus.mcs.net>

In article <pudge-2805981114250001@dynamic265.ply.adelphia.net>,
Chris Nandor <pudge@pobox.com> wrote:
>In article <6kju89$mb3$1@Mercury.mcs.net>, les@MCS.COM (Leslie Mikesell) wrote:
>
># >You are absolutely correct.  If I publish a book of my own algorithms,
># >which I invented and copyrighted and are fantastic and new to the world, I
># >can require that you don't use them in a program for sale.  However, that
># >would most likely fall under patent law.  You can't copyright an idea, you
># >have to patent it.  And since the code would likely not be used verbatim,
># >copyright law probably would not have much to say on the matter.
># 
># 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...
>
>Les, meet Point.  Point, meet Les. :)
>
>This has nothing to do with whether or not someone would want their
>examples to be used.  Motive and desire is irrelevant to this discussion.

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?

  Les Mikesell
   les@mcs.com


------------------------------

Date: 28 May 1998 13:48:40 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: Don't Know how to decrypt using PERL
Message-Id: <6kk81o$goc$1@monet.op.net>
Keywords: evangelic mouth nutmeg tongue


In article <1d9plpi.cto6hok4lup8N@slip166-72-108-10.ny.us.ibm.net>,
Kevin Reid <kpreid@ibm.net> wrote:
>What is the purpose of the salt?

			      SALT: WHY

Suppose the bad guy has obtained your password file, and wants to get
into your computer.  He can encrypt every word in the dictionary, then
look to see if any of the encrypted versions occur in the password
file.  Some surely does; now he has found a user whose password is a
dictionary word, and he can log in as them.  The dictionary can be
prepared in advance, and the attack is against every single passowrd
at once.

The salt prevents this.  It's used to modify the way the encryption
works, so that a word incruypted with one salt comes out different
form the same word encrypted with a different salt.

The bad guy can still encrypt the dictionary, but he must specify a
salt.  Then if a particular user has chosen a dictionary word as their
password, the bad guy will only recognize that if the password was
encrypted with the same salt.

There are 4096 different salts, so the bad guy must either prepare
4096 different encrypted dictionaries, or can only attack 1/4096 of
the passwords at once.

Thus the salt increases the cost of a brute-force password attack by a
factor of 4096.



------------------------------

Date: Thu, 28 May 1998 17:51:40 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Email address checker - comments welcome
Message-Id: <Pine.GSO.3.96.980528105049.29051L-100000@user2.teleport.com>

On Wed, 27 May 1998, Larry Rosler wrote:

> Michael J Gebis wrote in message <6ki3ou$rhv@mozo.cc.purdue.edu>...
> ...
> >It is, of course, possible to reject things that can't possibly work.
> ...
> 
> The following simple regex falls in that category.  It makes very few
> assumptions about what precedes the '@' and requires a Fully Qualified
> Domain Name (liberally defined) after the '@'.  The shortest string that
> matches it is 'w@x.yz'.  Comments welcome.
> 
> /^ [^\s@?]+ @ (?: \w[^\s.]* \. )+ \w\w+ $/x

    "fred barney"@redcat.com

:-)

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



------------------------------

Date: Thu, 28 May 1998 16:56:52 GMT
From: pinetree@my-dejanews.com
Subject: Re: Getting rid of carriage returns
Message-Id: <6kk50j$jbc$1@nnrp1.dejanews.com>

In article <6keou9$2nf$1@sloth.swcp.com>,
  "Oban Lambie" <oban@brownrice.com> wrote:
>
>
> Little help please...
>
> I'm using numerous perl scripts that write to straight line text file
> databases and I don't know how to get rid of carriage returns when they are
> submitted via a web form.
>
> $submittedText  =~ s/\n/\<br\>/g;

Try $submittedText =~ s/\r\n/\<br\>/g; instead. (UNIX, Mac, and Win all define
line breaks differently).

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


------------------------------

Date: Thu, 28 May 1998 19:29:20 +0200
From: Christopher Eltschka <celtschk@physik.tu-muenchen.de>
Subject: Re: GPL documentation == unspeakable evil
Message-Id: <356D9EF0.2369E2A@physik.tu-muenchen.de>

le Fanttme wrote:
> 
> On 25 May 1998 12:18:45 +1000, Stuart Cooper
> <stuartc@ind.tansu.com.au> wrote:
> 
> >The FSF is to be applauded for trying to produce free (in their sense)
> >documentation for Perl. The O'Reilly Perl books, excellent as they are,
> >are not free- I can't photocopy them for friends, download them from the
> >web etc. etc. If the O'Reilly books are indispensable documentation for
> >Perl as a whole, than Perl as a whole is not free (in the GNU and the
> >monetary sense).
> 
> This statement is, of course, silly. People buy the O'Reilly books
> because they are so damned good. I don't yet own a copy of anything
> except the Perl Reference (for Perl 5) because the on-line
> documentation has been quite comprehensive (and the few times when
> I've taken the time to compare, has been closely related to the text
> in the published books). As an additional note, some of my colleagues
> were able to download a .ps or PDF version of the Perl 5.004 Perl
> Reference and print it out for anyone who needed a copy at work.
> 
> >Of more concern is the "commercialisation" of Perl; with O'Reilly seemingly
> >becoming the owners of Perl.
> 
> Of more concern to who? Do you just not understand that without some
> level of commercial support (by which I mean the ability to use the
> software without it necessarily being required to give up your own
> intellectual property), free software will end up being mostly
> irrelevant? I'm not, as many people think I am, faulting the FSF and
> the GNU project for their moral stance -- I think it is stupid, but
> more to the point, there are just too many impractical folks in the
> FSF who feel that idealism toward this questionable goal far exceeds
> the results gained with practicality. The FSF has completely forgotten
> that there are carrots to be offered, but far prefers its stick.
> 
> >The Perl Resource Kit (PRK) is the most obvious
> >example of this trend; with the non-free "commercially enhanced" JPL stuff;
> >it comes with a Software License Agreement (make one copy only for backup
> >purposes, register for 30 days free support, special discount offers etc).
> >People who don't like the GNU Public License can read the PRK license and see
> >which they prefer.
> 
> You don't have to buy the PRK. Really. You don't. Perl itself remains
> free.
> 
> >Volumes 1 and 2 of the PRK I found interesting; straight copies of the
> >module documentation with a 'compilation copyright' (the compilation doesn't
> >seem that original either; the chapters are organised in the same order as
> >a view of CPAN. Maybe CPAN is in violation of ORA's "compilation copyright"?)
> >My CD with the PRK remains unopened.
> 
> Your choice.
> 
> >The copyrighting of the image of a camel is another interesting issue.
> >It makes me wonder where Perl is heading. How much of Perl is free, how much
> >will remain free? Will there be a free Perl 6 and a "commercially enhanced"
> >Perl 6; available only from ORA, just like the JPL stuff? The "open source"
> >software model allows for this practice; I read somewhere there may
> >be differing free and commercial versions of several familiar Internet
> >programs on the way.
> 
> Do people not understand that the Camel has become a sort of trademark
> item for Perl, and it *must* be protected?

IANAL, but isn't trademark protection exactly designed for that
purpose?
I think it's even better suited for that, since the copyright
cannot involve other images of camels, even if they have some
similarity. However if I used an image which is similar to the
Netscape logo for a non-Netscape browser (or probably any
non-Netscape product), they could sue me for trademark violation
(but not for copyright violation, since I never made a copy of the
image).


------------------------------

Date: Thu, 28 May 1998 17:09:34 GMT
From: robert havoc pennington <hp@pobox.com>
Subject: Re: Have we got a good free Perl manual?
Message-Id: <wsnn2c21fw1.fsf@harper.uchicago.edu>

tina@scandinaviaonline.se (Tina Marie Holmboe) writes:
> 
>   Pardon me, Sir, for then not having the faintest clue as to what is
>   being debated. Is it possible that someone actually wants to have good,
>   free (no cost) and 'free' Perl documentation, where the latter means that
>   anyone is able - and allowed - to fubar the same documentation ?
> 

What people want to do is have the right to modify the documentation
to match if they modify Perl. This is permitted by the GPL/Artistic
licenses, which apparently cover most of Perl, including most of the
docs, except for maybe perlfaq and perltoot. And yes, this implies the
right to fubar it as well as improve it, though presumably the fubar'd
copy would not see wide distribution since people would not be
interested.

www.opensource.org and www.gnu.org would be good starting points to
see what people are talking about here.

As you can see, however, this is not much of an issue, and what's
being debated is in fact not very important at all, IMO. Something
like "is there an error on a GNU web page" to which the answer is
pretty much "yes, they are full of errors even with respect to their
own projects." Everyone should just get over it.

Havoc Pennington ==== http://pobox.com/~hp


------------------------------

Date: Thu, 28 May 1998 17:38:57 GMT
From: robert havoc pennington <hp@pobox.com>
Subject: Re: Have we got a good free Perl manual?
Message-Id: <wsnk9761ej2.fsf@harper.uchicago.edu>

robert havoc pennington <hp@pobox.com> writes:
> 
> As you can see, however, this is not much of an issue, and what's
> being debated is in fact not very important at all, IMO. Something
> like "is there an error on a GNU web page" to which the answer is
> pretty much "yes, they are full of errors even with respect to their
> own projects." Everyone should just get over it.
> 

I should note that it would be a bigger deal if *all* the Perl docs
were non-free (opensource.org sense), but since it's only two man
pages AFAICT it's not especially important.

Havoc Pennington ==== http://pobox.com/~hp


------------------------------

Date: Thu, 28 May 1998 11:58:50 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: Need Perl Expert: how to identify Perl reserved word
Message-Id: <356D89BA.E8813E81@matrox.com>

Yongyan Wang wrote:

> I need to develop a subroutine that determine whether a string contains a perl-reserved-word. Suppose the subroutine is called "sub IsKey { ... }". Its retrun value is either "non-key word" or "key-word".

Other than the "keywords.pl" file mentioned by Larry Rosler's reply, I found a (complete?) list of reserved keywords at the end of the Safe.pm module, written by Malcolm Beattie .. I believe this module
comes with the standard Perl distribtion.

--
Ala Qumsieh             |  No .. not just another
ASIC Design Engineer    |  Perl Hacker!!!!!
Matrox Graphics Inc.    |
Montreal, Quebec        |  (Not yet!)





------------------------------

Date: Thu, 28 May 1998 17:00:25 GMT
From: jdporter@min.net (John Porter)
Subject: Re: new to OO Perl
Message-Id: <MPG.fd7640067d48e929896f9@news.min.net>

On Thu, 28 May 1998 08:52:05 -0700,
in article <6kk17v$53g@hplntx.hpl.hp.com>,
lr@hpl.hp.com (Larry Rosler) wrote:
> (Actually, 10 months is more like it!)

You know what I mean.

> The point is, it all depends. 

yes, exactly.

> And your table above shows clearly that OO increases those factors.

Well, it may be true, but I'm not sure my table shows that.


> The benefits of OO, in particular data abstraction and hiding, seem to
> me to be valuable only for maintaining the integrity of large programs
> being worked on by many hands ("programming in the large").  I'm not
> convinced that Perl is the right medium for such programs, nor have I
> seen evidence that Perl is in fact being used that way.

OO has worked wonderfully, seeing how it has been used in such 
modules as LWP and Tk.  It has allowed me to write a 10-line web
server in perl.  Maybe my program wasn't large, but the libraries
of classes I'm drawing on are huge, some of them.  I would say that
meets your criteria for programming in the large.  In which case
you've got plenty of evidence right under your nose.


> I don't see how OO helps you write your write-fast/run-slow program
> faster, but I can certainly see how it helps it run slower.

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?

And as I said, this topic has been beaten to death already.
But I'll say it again: if speed is that important, maybe Perl
is not the best language for you.  It would be silly to write
a transaction processor in perl, if it has to handle a realistically
high number of xns per sec.




------------------------------

Date: Thu, 28 May 1998 16:53:25 GMT
From: adelton@fi.muni.cz (Honza Pazdziora)
Subject: Re: Page redirection slide show
Message-Id: <adelton.896374405@nemesis>

AlexLesniara@my-dejanews.com writes:

> I know I can use print "Location: ....
> to redirect to other pages on the web.
> But I would like to be able to do something like this:
> 
> print "Location: http://www.domain1.com\n\n";
> print "Location: http://www.domain2.com\n\n";
> print "Location: http://www.domain3.com\n\n";

No this way, AFAIK. Once you redirect to http://www.domain1.com you
have to do the next redirection from there. But of course, you would
get more authoritative answer form some *.www.* group.

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: Thu, 28 May 1998 17:53:25 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: perl5 <=> perl4 incompatibility ?
Message-Id: <Pine.GSO.3.96.980528105257.29051M-100000@user2.teleport.com>

On 27 May 1998, Emil Vatralov wrote:

> Do you refer to the below exerpt from perltrap ?

No, it's this one. Hope this helps!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/

=item * C<split> on empty string with LIMIT specified

        $string = '';
    @list = split(/foo/, $string, 2)

Perl4 returns a one element list containing the empty string but Perl5
returns an empty list.




------------------------------

Date: Thu, 28 May 1998 16:51:50 GMT
From: mick@picus.dcs.bbk.ac.uk (Mick Farmer)
Subject: Re: Reading whole file into a scalar
Message-Id: <EtoEuF.97J@mail2.ccs.bbk.ac.uk>

Dear Mike,

If you're sure you want to do this, then try the following.

	$file = join '', <>;

Regards,

Mick


------------------------------

Date: Thu, 28 May 1998 17:24:01 GMT
From: jeff@yoak.com (Jeff Yoak)
Subject: Re: Statistics for comp.lang.perl.misc
Message-Id: <6kk6fu$405@dfw-ixnews10.ix.netcom.com>

gabor@vmunix.com (Gabor) wrote:


>I think this clearly shows the need for a moderated newsgroup.  Any
>Perl topics?  I guess 'Why NOT crypt?' might qualify.

Whatever might be said about the nature and persistance of the
arguments in these threads, inasmuch as the issue at stake is the
license under which perl and Perl documentation are offered I think
the conversation is appropriate here.  I would be surprised if the
proposed moderators would disallow these threads.  Perhaps one of them
might comment on it.

Cheers,
Jeff

-- 
Jeff Yoak         jeff@yoak.com



------------------------------

Date: Thu, 28 May 1998 17:40:41 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: using 'read' in a CGI script ?
Message-Id: <Pine.GSO.3.96.980528103459.29051I-100000@user2.teleport.com>

On Thu, 28 May 1998, Daniel FAUXPOINT wrote:

> I know CGI.pm does all I need to get my parameters, but I would like to
> understand why I can't get 'read' to work.

Okay...

> I would like to use
> read(STDIN, $in, $ENV{'CONTENT_LENGTH'}, 0);
> in a perl script that processes a form.
> 
> The script seems to stay stuck on the call to 'read' when I submit my
> form from any browser.

That's because you're not implementing the CGI protocol according to the
spec. :-) But it looks to me as if the call is blocking while waiting for
input. Hope this helps! 

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



------------------------------

Date: Thu, 28 May 1998 17:43:19 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Using Perl 5 with Frontpage and Personal Web Server
Message-Id: <Pine.GSO.3.96.980528104154.29051J-100000@user2.teleport.com>

On Wed, 27 May 1998, Johan De Coninck wrote:

> Has anyone any feedback or documentation about how to use Perl 5 with
> Frontpage and Personal Web Server on a local drive for testing purposes ?

If you're using a module like CGI.pm to write your CGI scripts, you can
test them from the command line without a server or browser. You can even
use the Perl debugger! But if you need more information about your server,
the docs, FAQs, and newsgroups about servers should be able to help you.
Good luck!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



------------------------------

Date: Thu, 28 May 1998 16:47:13 GMT
From: adelton@fi.muni.cz (Honza Pazdziora)
Subject: Re: Visibility of "my" vars
Message-Id: <adelton.896374033@nemesis>

bkline@cortex.nlm.nih.gov (Bob Kline) writes:


> The man page for perlsub has the following passage:
> 
> "Unlike dynamic variables created by the ``local'' statement, lexical
> variables declared with ``my'' are totally hidden from the outside world,
> including any called subroutines ...."
> 
> This would appear to be saying that any called subroutines would not
> be able to see a lexically scoped variable declared/defined at file
> scope, but this does not appear to be matched by the behavior of Perl
> 5.004, at least the builds I have been working with:
> 
> % cat t.pl
> my $foo = 8;
> &bar;
> sub bar
> {
>     $foo += 3;
>     print "$foo\n";
> }
> % perl t.pl
> 11
> % 
> 
> Is this a bug in the documentation?  Can the behavior I'm observing
> be relied upon in future versions?  Or is the bug in the implementation

No. Yes. No.

The my $foo is declared at the outer level of the file so it's visible
in all nested blocks, which your sub bar definitely is. It's the same
as

my $foo = 8;
{
print $foo + 3, "\n";
}

quite naturaly prints 11. Compare you example with

{
my $foo = 8;
}
&bar;
sub bar
{
    $foo += 3;
    print "$foo\n";
}
__END__

which gives 3.

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: Thu, 28 May 1998 16:36:48 GMT
From: David Cross-cmt <Dave.Cross@gb.swissbank.com>
Subject: Re: Wanted: info on passing args to functions in perl5
Message-Id: <eq0vhqq9wtb.fsf@gb.swissbank.com>

karres@southwind.net (Dean Karres) writes:

> 
> Hi,

Hello!,

[snip]
  
> the subsequent subroutine call looks like:
>     
>     if (! filterBillingRecords($LOGDIR, \$DB_method, \$Tree,
>                                \%acpRecord))
>     {
>         die "Can not open logfiles\n$!\n";
>     }
> 
> 
> the subroutine accepts the parameters as:
> 
>     my($dir, $DB_method, $Tree, %acpRecord) = @_;
> 
> 
> 'K.  When I run this I get the message:
> 
>     Odd number of elements in hash list at filterBillingRecords.pl line 22.
> 
> which is the above "my" line in the subroutine.  The book says that this
> message means what it says - there is an odd number of things in the
> hash - which is odd because hashes are paired things...

You're passing in four scalar values (three of which are references) and
your subroutine is expecting three scalars and a hash. The last reference
(\%acpRecord) is being assigned to a hash (%acpRecord) which creates a
hash with only one element (the ref) and one is an odd number.

To correct it, change the sub to expect four scalars and treat the last
one as a reference to a hash (which is, after all, what it is). i.e.

my ($dir, $DB_method, $Tree, $acpRecord) = @_;

$acpRecord->{field} = 'something';

hth,

Dave...

-- 
If I wasn't so busy writing status reports,
my status report might just become a progress report.

Dave.Cross@gb.swissbank.com


------------------------------

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 2750
**************************************

home help back first fref pref prev next nref lref last post