[13846] in Perl-Users-Digest
Perl-Users Digest, Issue: 1256 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Nov 2 15:10:32 1999
Date: Tue, 2 Nov 1999 12:10:18 -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: <941573418-v9-i1256@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Tue, 2 Nov 1999 Volume: 9 Number: 1256
Today's topics:
Re: It is always like this here? <jon@midnightbeach.com>
Re: It is always like this here? <jon@midnightbeach.com>
Re: It is always like this here? <jon@midnightbeach.com>
Re: It is always like this here? <lr@hpl.hp.com>
Re: mod perl anomalies <tom@tnunn.demon.co.uk>
Perl & Internal Date on Wintel (Eisen Chao)
Re: Perl & Internal Date on Wintel <lr@hpl.hp.com>
Re: perl double-split <ltl@rgsun5.viasystems.com>
Re: perl double-split <ltl@rgsun5.viasystems.com>
perl on ms PWS on win98 <md@golden-net.co.uk>
Re: perl on ms PWS on win98 (Bill Moseley)
Re: Perl4 and Y2K <rootbeer@redcat.com>
Re: please explain ${1+"$@"} (Alan Curry)
Re: Premature End Of Script Headers <marcel.grunauer@lovely.net>
Re: Range operators: two dots v.s. three dots (Randal L. Schwartz)
Re: replacing special characters to %xx for browsers <khera@kciLink.com>
Re: Report pagebreak & page-count <rootbeer@redcat.com>
Re: Something like FLY except for JPGs <rwentwor@advent.com>
Re: Sort order in Perl <lr@hpl.hp.com>
Re: speeding up split() <rootbeer@redcat.com>
Re: speeding up split() (Ilya Zakharevich)
Re: What makes the web go? <marcel.grunauer@lovely.net>
Re: What makes the web go? (Mark W. Schumann)
Re: Why can't I get this uniq/perl thing right? <shon@mad.scientist.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 02 Nov 1999 09:30:51 -0800
From: Jon Shemitz <jon@midnightbeach.com>
Subject: Re: It is always like this here?
Message-Id: <381F1FCB.A8D2FE9E@midnightbeach.com>
David Cassell wrote:
> > Perhaps this suggestion comes up a lot, too: Split the group.
>
> This suggestion does come up a lot. Perhaps monthly. And
> the group *has* been split. And analysis has concluded
> that it just doesn't help when too many people don't know
> what the Usenet rules are, and/or don't follow them.
But that's the beauty of a 'lightly moderated' group: It filters out the
rule-breakers and nothing but the rule-breakers. It leaves the real
experts a place where they can discuss esoterica without being badgered
by novices questions; and leaves the novices and intermediates a place
where they discuss their problems with their peers, which can be one of
the best ways to learn. I think it's really *wrong* that people should
feel that they shouldn't post answers here until they've used Perl
intensively for six months or a year.
> > Maybe there should be a comp.lang.perl.cgi.
>
> But when they don't know whether their problem is HTTP, HTML,
> CGI, webserver config, Perl, or Javascript, they do *not* go
> to the right group.
Right. And they piss people off, and get sent NastyGrams. Not very
productive for either side. But if there was a fly trap group, they
wouldn't be asking these questions in a 'pure Perl' group, and they just
might get a useful answer from someone who was just as clueless two
months ago.
> > months or weeks. You just have to live with that, and evolve new
> > mechanisms to deal with it, not keep on insisting on what worked five or
> > fifteen years ago.)
>
> What would you suggest? The way that many groups with this
> problem have gone is to totally fall apart so that the group
> is no longer useful for its original purpose [e.g., go see
> comp.unix.wizards ].
Well, I did make two specific suggestions, and I *thought* my msg was
innoculated against comp.unix.wizards citing. ;)
I do appreciate the fact that this group has mostly managed to survive
the onslaught of newbies with something of the old Usenet spirit still
intact. I do appreciate how much I learn reading other people's
questions and the answers to them. But I *don't* appreciate the bitter
tone.
I've never lived in a really small town, but I gather that they can be
both close and exclusive. They don't actively insult newcomers; they
just don't see them until they've lived there for a decade or two.
Perhaps a little more ignoring the dumb questions would help the tone,
here.
> Well, I think that in many cases, people just do not have the
> resources. They write some code for their website on an ISP's
> server and never learn what a private copy of Perl has to offer.
> Or they download from ActiveState and do not know that they
> now have a copy of the docs and the FAQ. These people can
> best be helped by telling them where to find the documentation
> they want. While saying "RTFM" doesn't help these posters,
> explaining about the FAQ and perldoc *should* help.
You may be right.
> > Who would have time to moderate the new group? Why, I would think
> > that anyone who has the time to respond "FAQ" to FAQ's has more than
> > enough time to say Yeah or Nay to each thread.
>
> Well, there's a bit of a difference between using a scoring
> newsreader and looking at 20 posts a day, vs. being moderator
> here and having to handle *two*hundred* posts a day.
Yes, that's very true. Otoh, isn't it possible to moderate on a thread
basis? Ie, one would only have to pass judgement on new threads?
> There already is a comp.lang.perl.moderated, which serves
> a number of these purposes. It is a low-traffic, high S/N
> newsgroup.
Yes, and people complain that it is *too* low-traffic.
--
http://www.midnightbeach.com - Me, my work, my writing, and
http://www.midnightbeach.com/hs - my homeschool resource pages
------------------------------
Date: Tue, 02 Nov 1999 09:36:26 -0800
From: Jon Shemitz <jon@midnightbeach.com>
Subject: Re: It is always like this here?
Message-Id: <381F211A.55B2F77@midnightbeach.com>
Abigail wrote:
> () Perhaps this suggestion comes up a lot, too: Split the group.
>
> Yes it does. Apparently, you seem to suffer from the same disease
> many people being flamed suffer from to: the inability to read.
>
> It's been suggested here, oh, about 12 times a week?
>
> Read the frigging group, and you would have known.
Oooh, now I've been flamed by Abigail! How perfectly charming.
You know, when I first subscribed to c.l.p.m, I read the subject lines
on all the threads on my news feed. I read through quite a few of the
threads. On a daily basis, I read the subject lines of threads with new
material, and look into a few.
Splitting the group may, indeed, have been suggested twelve times a week
in this time - but I haven't seen it.
> Apparently, you are unware of c.l.p.moderated.
>
> Please do your homework, and come back if you have something new.
Nope, I read it, too. And I'm aware that people here complain that the
moderated group is *too* low-volume. (Perhaps you haven't seen those
messages?)
Actually, Abigail dear, I was thinking that you would be a perfect
moderator. You seem to have way too much time on your hands.
--
http://www.midnightbeach.com - Me, my work, my writing, and
http://www.midnightbeach.com/hs - my homeschool resource pages
------------------------------
Date: Tue, 02 Nov 1999 09:46:05 -0800
From: Jon Shemitz <jon@midnightbeach.com>
Subject: Re: It is always like this here?
Message-Id: <381F235D.EC34A2DD@midnightbeach.com>
David Cassell wrote:
> If you can see a better way of dividing up the sections,
> email your suggestion(s) to:
> perlfaq-suggestions@perl.com
>
> BTW, that address is in the FAQ too.
Ooops!
> > This might be as good a place as any to ask: Why does perldoc behave so
> > badly under Win32? [....]
> [snip]
>
> Because win95/98 has such broken pipes. As I understand
> the problem, ActiveState has put a fixed perldoc up on their
> site and it should work with the latest stable build of Perl.
Possibly part of Build 521 - I'll try it and see. Thanks.
> > Yes, that would be great. I've done several searches that don't turn up
> > the info I later find looking through the questions. And I think looking
> > through a long list of questions is a lousy way of finding info.
>
> Agreed. Maybe you would be willing to build a FAQ index and
> matching indexing tool? [Should I put a smiley here?]
No, no smiley needed. In between paying work, I'm working on a search
engine for my site; I could probably adapt it to the FAQ without too
much trouble, perhaps before the end of the year. If y'all promise not
to laugh at my code.
--
http://www.midnightbeach.com - Me, my work, my writing, and
http://www.midnightbeach.com/hs - my homeschool resource pages
------------------------------
Date: Tue, 2 Nov 1999 11:03:22 -0800
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: It is always like this here?
Message-Id: <MPG.1288d554c0a8c10798a18f@nntp.hpl.hp.com>
In article <pudge-0211990941200001@192.168.0.77> on Tue, 02 Nov 1999
14:41:15 GMT, Chris Nandor <pudge@pobox.com> says...
> In article <MPG.128389a13eb7ea6e98a15c@nntp.hpl.hp.com>, Larry Rosler
> <lr@hpl.hp.com> wrote:
> # In article <pudge-2910991143560001@192.168.0.77> on Fri, 29 Oct 1999
> # 15:44:58 GMT, Chris Nandor <pudge@pobox.com> says...
> # > That is why comp.lang.perl.moderated was created.
> #
> # And has almost no traffic, hence almost no information.
>
> Since when? Almost no traffic? Perhaps you have a bad feed.
I think you are right. I just took a look at Deja.com for all articles
sorted by date, and found many that I haven't seen, within the past
month alone.
I'll ask my local Netnews person to look into it.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Tue, 2 Nov 1999 19:16:44 +0000
From: Thomas Nunn <tom@tnunn.demon.co.uk>
Subject: Re: mod perl anomalies
Message-Id: <VHwuZCAcizH4EwTi@tnunn.demon.co.uk>
In article <FKJ18C.Ew@csc.liv.ac.uk>, I.J. Garlick <ijg@connect.org.uk>
writes
>In article <1x+KmBAkyNG4Ew8p@tnunn.demon.co.uk>,
>Thomas Nunn <tom@tnunn.demon.co.uk> writes:
>>>This happened to me when I first tried to use mod_perl (I just dived in
>>>and tried to run before I had even relised crawling may have been a better
>>>bet).
>>>
>>
>> I wish I had time for crawling, I don't think my boss would be amused
>> however.
>
>It's faster in the long run. :-)
Yes I know, I'm sort of running a bit, then crawling when I fall over,
but then every so often when some freak hurricane picks me up and puts
me back where I...
Twang!
Oh well, there goes that metaphor.
>
>> That would probably be very useful, but I'm still confused. I was led to
>> believe that if I declare all my variables as being local, they should
>> all die as soon as that particular script has finished running. Why
>> would these values still be in memory?
>
>Normally it does. But when your using mod_perl the process that runs your
>CGI is the httpd pprocess it's self. Since this hangs around for 30 odd
>requests before killing it's self and starting a fresh process usually you
>can see how it may hang on to values. Like $_, $/, $1...., @_ etc... do
>you local all them? According to the way I understand it. If you put
>something in $_ towards the end of the script. The httpd process hangs
>onto it and may use the value in $_, next time it's used, if you are not
>careful. This is what got me the first time I tried mod_perl, I think.
>
I suppose that could be it, although I'm fairly sure I'm reassigning
those each time the script runs. Hmm, still not sure.
I've kind of been distracted from this little problem, I've been using
the script with the normal compiler. I still need to get 'round this
issue and get everything into mod_perl.
>>
>> ...Unless of course the script doesn't finish running.. Aha that could
>> be it..
>
>Yep effectively although probably not the way you think. As brian said it
>took several re-reads to grasp this let alone understand it.
>
Okay, I'll go back and give it a few more reads.
--
Thomas Nunn
------------------------------
Date: Tue, 02 Nov 1999 17:19:20 GMT
From: echao@interaccess.com (Eisen Chao)
Subject: Perl & Internal Date on Wintel
Message-Id: <s1u78o4t24225@corp.supernews.com>
Keywords: Getting Correct Date from Intel Platform
Hi All,
I tried using localtime() and got a date of 10-02-1999!
I am using ACTIVESTATE's Perl, Build 521.
From what I recollect about PCs, they have (2) internal
dates and it looks like the localtime function on my
IBM desktop is grabbing the bogus one. When I type
'date' at the command prompt I get the corect date.
If I use Time::gmtime(), everything is correct.
My (2) questions are:
1) gmtime() returns one big string, with the Month
as an alpha name. Is there a way of parsing it
in the manner of localtime() (i.e. Month as numeric) ?
2) Any way of getting localtime to pick out the
same source for time as gmtime ? I'd like to
get localtime working, because of all the
better documentation available. If it is hardwired
then I am out of luck. Is there some magic parm
somewhere or feature ?
Thanks in Advance,
Eisen
Chicago
P.S. I do have a workaround with gmtime; it irks me
to not be able to use localtime()!
------------------------------
Date: Tue, 2 Nov 1999 10:09:46 -0800
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Perl & Internal Date on Wintel
Message-Id: <MPG.1288c8c1cd90a79b98a18c@nntp.hpl.hp.com>
In article <s1u78o4t24225@corp.supernews.com> on Tue, 02 Nov 1999
17:19:20 GMT, Eisen Chao <echao@interaccess.com> says...
> I tried using localtime() and got a date of 10-02-1999!
How? Have you read the documentation for localtiome()?
...
> 1) gmtime() returns one big string, with the Month
> as an alpha name. Is there a way of parsing it
> in the manner of localtime() (i.e. Month as numeric) ?
The string is returned in scalar context. A list of numbers is returned
in list context. Have you read the documentation for gmtime()?
> 2) Any way of getting localtime to pick out the
> same source for time as gmtime ? I'd like to
> get localtime working, because of all the
> better documentation available. If it is hardwired
> then I am out of luck. Is there some magic parm
> somewhere or feature ?
localtime() and gmtime() differ only in terms of a relative offset that
is determined by the operating system. Their documentation is almost
identical. You are finding distinctions where there really aren't any.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 2 Nov 1999 19:37:39 GMT
From: lt lindley <ltl@rgsun5.viasystems.com>
Subject: Re: perl double-split
Message-Id: <7vnei3$q5a$1@rguxd.viasystems.com>
Anno Siegel <anno4000@lublin.zrz.tu-berlin.de> wrote:
:>lt lindley <lee.lindley@viasystems.com> wrote in comp.lang.perl.misc:
:>>Kenneth Bandes <kbandes@home.com> wrote:
:>>:>Ilya Zakharevich wrote:
:>>:>> my $values = <> ?? die "'Name' line without matched 'values' line.\n";
:>>:>>
:>>:>> is the proper solution.
:>>
:>>:>Is ?? in the language? I've got 5.005 patch 61 and it isn't documented
:>>:>(except in perltodo as "or" testing defined not truth, which I assume
:>>:>is what you mean) that I can find.
:>>
:>><Groan>
:>>Once that operator exists people will never stop harping on
:>>looking out for the case where <> returns the string 0 without
:>>a newline; a condition that has about as much chance of happening
:>>in any reasonable dataset as I do of winning the lottery.
:>></Groan>
:>But, but... the ?? operator would really do its thing to make people
:>*stop* harping about that condition. "??" would let you use '0' as a
:>valid line, while "or" would skip it.
:>Btw, the last line not being followed by "\n" is standard in MacOS
:>(and probably others), where "\n" is a line separator, not terminator.
:>I believe that perl IO supplies the missing final "\n", but a file
:>sloppily transferred from MacOS to Unix could easily come without it.
:>Good luck with the lottery.
:>Anno
--
// Lee.Lindley /// I used to think that being right was everything.
// @bigfoot.com /// Then I matured into the realization that getting
//////////////////// along was more important. Except on usenet.
------------------------------
Date: 2 Nov 1999 19:41:00 GMT
From: lt lindley <ltl@rgsun5.viasystems.com>
Subject: Re: perl double-split
Message-Id: <7vneoc$q5a$2@rguxd.viasystems.com>
Anno Siegel <anno4000@lublin.zrz.tu-berlin.de> wrote:
:>>in any reasonable dataset as I do of winning the lottery.
----------^^^^^^^^^^
[snip]
:>Btw, the last line not being followed by "\n" is standard in MacOS
:>(and probably others), where "\n" is a line separator, not terminator.
:>I believe that perl IO supplies the missing final "\n", but a file
:>sloppily transferred from MacOS to Unix could easily come without it.
I get to define "reasonable" and was careful to phrase it that way. :-)
Sorry about the "all quote" post that preceeded this one. My finger
slipped onto the return key at an inopportune moment and I have not
been able to figure out how to prevent tin from doing this. I may
have to switch newsreaders.
--
// Lee.Lindley /// I used to think that being right was everything.
// @bigfoot.com /// Then I matured into the realization that getting
//////////////////// along was more important. Except on usenet.
------------------------------
Date: Tue, 2 Nov 1999 18:06:06 -0000
From: "Chris Mannings" <md@golden-net.co.uk>
Subject: perl on ms PWS on win98
Message-Id: <7vn908$dj4$1@gxsn.com>
Any body know an easy way to get perl to run on a web located on a ms
Personnal Web Server running on w98? tried mapping to perl exe in regedit,
tried file assoc in control panel, still getting 'server error 505'. Any
good ideas?
thanks
chris
chris@golden-net.co.uk
------------------------------
Date: Tue, 2 Nov 1999 11:36:27 -0800
From: moseley@best.com (Bill Moseley)
Subject: Re: perl on ms PWS on win98
Message-Id: <MPG.1288dd15bad926fd989830@nntp1.ba.best.com>
Chris Mannings (md@golden-net.co.uk) seems to say...
> Any body know an easy way to get perl to run on a web located on a ms
> Personnal Web Server running on w98? tried mapping to perl exe in regedit,
> tried file assoc in control panel, still getting 'server error 505'. Any
> good ideas?
Sure. Install another web server. I like Apache.
--
Bill Moseley mailto:moseley@best.com
pls note the one line sig, not counting this one.
------------------------------
Date: Tue, 2 Nov 1999 10:51:43 -0800
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Perl4 and Y2K
Message-Id: <Pine.GSO.4.10.9911021030440.29670-100000@user2.teleport.com>
On Mon, 1 Nov 1999, Larry Rosler wrote:
> > Don't you think that anyone who is worried about Y2K bugs in that old
> > version of Perl should upgrade at once?
>
> No. As I said in another branch of this thread, I would continue offer
> Perl 4, and I would make Perl 5 available.
Okay.... But you should know that it is possible that someone could use a
bug in an old perl binary to break into your system, depending on how
things are set up. Many (many!) CERT advisories deal with exploits due to
buffer overruns, including some advisories about buffer overruns in older
versions of perl. So, that's why I wouldn't continue to let people use
Perl 4.
Oh, and if someone breaks into your site and starts sending SPAM,
attacking other sites, and generally causing you troubles, you probably
won't continue to let anyone use old Perl versions, either. :-)
Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 02 Nov 1999 19:53:23 GMT
From: pacman@defiant.cqc.com (Alan Curry)
Subject: Re: please explain ${1+"$@"}
Message-Id: <TiHT3.22213$23.1134246@typ11.nn.bcandid.com>
In article <UunT3.17884$23.964623@typ11.nn.bcandid.com>,
Kragen Sitaker <kragen@dnaco.net> wrote:
>In article <381DF5B0.E3BF5901@email.mot.com>,
>Chicheng Zhang <Chicheng_Zhang-P29601@email.mot.com> wrote:
>>what does perl -x $0 ${1+"$@"} mean?
>>
>>I know the difference between $@ and $*, but why need ${1+"$@"} anyway?
>>Please explain.
>
>When there are no args, "$@" is "" -- a single arg of the null string.
Only if your shell is really old. In modern shells, there's no difference
between "$@" and ${1+"$@"}. The last I heard, HPUX was the only one to still
have the bug. (And the only one to still have #, @, and DEL as the default
tty erase, kill, and intr characters.)
--
Alan Curry |Declaration of | _../\. ./\.._ ____. ____.
pacman@cqc.com|bigotries (should| [ | | ] / _> / _>
--------------+save some time): | \__/ \__/ \___: \___:
Linux,vim,trn,GPL,zsh,qmail,^H | "Screw you guys, I'm going home" -- Cartman
------------------------------
Date: Tue, 02 Nov 1999 19:06:26 GMT
From: Marcel Grunauer <marcel.grunauer@lovely.net>
Subject: Re: Premature End Of Script Headers
Message-Id: <ZEMfOOVhwxRIiVD=iIjFK5nUPin=@4ax.com>
On Tue, 02 Nov 1999 03:08:46 GMT, kragen@dnaco.net (Kragen Sitaker)
wrote:
> >p.s. sorry for the cgi content, but I can't approve any messages to
> >comp.infosystems...cgi.
>
> Why does it have to be our problem? If you aren't able to post on an
> appropriate newsgroup, why do you have to pick comp.lang.perl?
> Couldn't you post your question on alt.lemurs or alt.tasteless or
> something?
That sounds like an Abigailism :-)
--
Marcel, Perl Padawan
sub AUTOLOAD{$_=$AUTOLOAD;s;.*::;;;y;_; ;;print}&Just_Another_Perl_Hacker;
------------------------------
Date: 02 Nov 1999 11:17:34 -0800
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Range operators: two dots v.s. three dots
Message-Id: <m1n1swaek1.fsf@halfdome.holdit.com>
OK, so I came up with my own test, staring at this:
In scalar context, ".." returns a boolean value. The
operator is bistable, like a flip-flop, and emulates the
line-range (comma) operator of sed, awk, and various
editors. Each ".." operator maintains its own boolean
state. It is false as long as its left operand is false.
Once the left operand is true, the range operator stays
true until the right operand is true, AFTER which the
range operator becomes false again. (It doesn't become
false till the next time the range operator is evaluated.
It can test the right operand and become false on the same
evaluation it became true (as in awk), but it still
returns true once. If you don't want it to test the right
operand till the next evaluation (as in sed), use three
dots ("...") instead of two.) The right operand is not
evaluated while the operator is in the "false" state, and
the left operand is not evaluated while the operator is in
the "true" state. [...]
Here's my test:
for (qw(none leftright none right none)) {
printf "%20s .. %3s ... %3s\n", $_,
(scalar (/left/../right/) ? "YES" : "NO"),
(scalar (/left/.../right/) ? "YES" : "NO");
}
And the results:
none .. NO ... NO
leftright .. YES ... YES
none .. NO ... YES
right .. NO ... YES
none .. NO ... NO
And that looks correct... the /right/ on the "..." didn't test on
the same line as the /left/ did... it had to wait further.
I'm not sure how Abigail got those results.
$ perl -wle 'for (qw /foobar barbar bazbar/) {print}' |\
perl -wne 'print if /foo/ .. /bar/'
foobar
barbar
$ perl -wle 'for (qw /foobar barbar bazbar/) {print}' |\
perl -wne 'print if /foo/ ... /bar/'
foobar
$
Because I get exactly the opposite when I run my 5.5.3 Perl against
that code! Abigail, what Perl are you running?
print "Just another Perl hacker,"
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
------------------------------
Date: 02 Nov 1999 13:38:39 -0500
From: Vivek Khera <khera@kciLink.com>
Subject: Re: replacing special characters to %xx for browsers
Message-Id: <x7so2olowg.fsf@kci.kciLink.com>
>>>>> "RLS" == Randal L Schwartz <merlyn@stonehenge.com> writes:
RLS> That's not CGI.pm. I don't believe anything on the web... it's
RLS> too much of a fad. :-)
RLS> Anyway, until it's in CGI.pm, I'd avoid it.
Then you'll have to avoid a *LOT* of what's in CGI.pm. Lincoln has
stated that the full docs are in the HTML version, not the pod.
Besides, the HTML docs come with CGI.pm when you download it, doesn't
it?
--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Vivek Khera, Ph.D. Khera Communications, Inc.
Internet: khera@kciLink.com Rockville, MD +1-301-545-6996
PGP & MIME spoken here http://www.kciLink.com/home/khera/
------------------------------
Date: Tue, 2 Nov 1999 11:47:20 -0800
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Report pagebreak & page-count
Message-Id: <Pine.GSO.4.10.9911021139380.29670-100000@user2.teleport.com>
On Tue, 2 Nov 1999, dVoon wrote:
> I have a series of reports to print. Each report resites in a different
> subroutine, has its own format and top-of-page-format and so on. What I
> want is to force a page-break and reset the page count after every
> report. I have this subroutine below:
>
> sub linefeed{
>
> $~ = "LINEFEED";
> write( STDOUT );
> $% = 0;
> $- = 0;
>
> format LINEFEED =
> .
> }
Perhaps you should omit the argument to write(), so you could use the
currently-selected filehandle there, as you do on the other lines. That
would seem more useful, to me. But wouldn't something like this work?
sub force_page_break {
print $^L;
$% = 0;
$- = 0;
}
I haven't checked this, but it looks to me to be what you're looking for.
Good luck with it!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 02 Nov 1999 18:35:15 GMT
From: Rossz <rwentwor@advent.com>
Subject: Re: Something like FLY except for JPGs
Message-Id: <7vnat3$aeg$1@nnrp1.deja.com>
In article <slrn81t8sb.66b.abigail@alexandra.delanet.com>,
abigail@delanet.com wrote:
> And your Perl question is?
Since the question was asked in a perl newsgroup, it is implied that a
perl solution is being sought. The first person who responded to the
question did, in fact, provide a perl solution, therefore validating
the question:
"PerlMagick will do what you want, but it may be a bit overkill."
Before I read your response I made a bet with myself that you would say,
"this is not a perl question". I feel I can claim to have won the bet.
When I first began reading this newsgroup I read the rather ill-mannered
posting regarding you. Not knowing any better, I believed people were
overreacting. I now know better.
Your presence in this newsgroup is rarely beneficial to the perl
community. Your spiteful attitude towards anyone with a question only
propagates the well deserved bad reputation of comp.lang.perl.misc. If
I ever post a question, do me a favor and don't bother to answer. I
don't need your help.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 2 Nov 1999 10:26:58 -0800
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Sort order in Perl
Message-Id: <MPG.1288ccc98c4008f998a18e@nntp.hpl.hp.com>
In article <7vmv7d$anm$1@lublin.zrz.tu-berlin.de> on 2 Nov 1999 15:15:57
-0000, Anno Siegel <anno4000@lublin.zrz.tu-berlin.de> says...
> <h.benne@library.uu.nl> wrote in comp.lang.perl.misc:
...
> >I want to sort an array with names that contains diacritical characters in a
> >different way Perl does by default.
> >
> >The order words are sorted by Perl is not the way I want it to be. The
> >diacritical character 'ö' for example is sorted after the 'z' and I want it to
> >be sorted as 'oe'. The same for 'ä' (ae) and 'ü' (ue). Is this possible ?
>
> Why, yes. use locale; might be all you need. That failing, to sort
> your strings, create a hash %strings that has the original strings for
> keys and the same strings with the umlauts substituted by whatever you
> need for values (s///g). Then
> sort { $strings{ $a} cmp $strings{ $b}}, keys %strings;
> and you're set.
See the article "International Sorting with sort" (Grappling with
"funny" letters? Bi-level sorting can help. Sean M. Burke) in The Perl
Journal, Volume 4, Number 2 (#14), Summer 1999.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Tue, 2 Nov 1999 10:07:21 -0800
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: speeding up split()
Message-Id: <Pine.GSO.4.10.9911020858350.29670-100000@user2.teleport.com>
On Mon, 1 Nov 1999, TK Soh wrote:
> I am trying to speed up the split() statement in my program that has
> to split a tab-delimited file in to arrays of about 1200 elements for
> each line.
Wow, that's a lot of elements. My guess is that it's slow to allocate 1200
scalars like that.
> BTW, my home brewed split function with XSUB, though works, was too
> slow to mention.
You're probably allocating 1200 scalars there, too. :-)
Here's a technique to consider. It may be faster or slower, but don't test
it by itself - it's whether it's faster or slower as you use it that
matters. (More about this in a moment.)
Have your XSUB keep two chunks of memory. One is the original string, and
the other is the table of field-starts within the string. (That is, it's a
C array showing the positions of tab characters. I'm sure you can see that
it should be quite fast in C to build this table.)
When you need an element from the array, your XS code will be able to
pluck it from the string very quickly. You can make this a tied array
(read only), but I don't know how much overhead that would add.
Now, as to how the usage affects the speed. If you typically need to
access only three or four of the elements, it should be much faster this
way than to use split. On the other hand, if you really need 1200 scalars
in an array, those will take time to allocate, and this approach would
probably not help.
Another possible approach would be to make the XS code do more of whatever
it is you're trying to accomplish - but, of course, the more you do in XS,
the less Perl-like your solution will be.
Good luck with it!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 2 Nov 1999 19:58:15 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: speeding up split()
Message-Id: <7vnfon$n02$1@charm.magnus.acs.ohio-state.edu>
[A complimentary Cc of this posting was sent to Tom Phoenix
<rootbeer@redcat.com>],
who wrote in article <Pine.GSO.4.10.9911020858350.29670-100000@user2.teleport.com>:
> > BTW, my home brewed split function with XSUB, though works, was too
> > slow to mention.
>
> You're probably allocating 1200 scalars there, too. :-)
>
> Here's a technique to consider. It may be faster or slower, but don't test
> it by itself - it's whether it's faster or slower as you use it that
> matters. (More about this in a moment.)
Or alternatively, support my patch which introduced a pragma to kill
this splitting-to-$@ bug.
Ilya
------------------------------
Date: Tue, 02 Nov 1999 19:18:11 GMT
From: Marcel Grunauer <marcel.grunauer@lovely.net>
Subject: Re: What makes the web go?
Message-Id: <mUQfOA2U0q22lfRZdm25XY0Xnt=w@4ax.com>
On 2 Nov 1999 08:08:37 -0500, catfood@apk.net (Mark W. Schumann)
wrote:
> Who the hell is this Brian Foy guy anyway? Read a FAQ once in a while,
> kid.
>
> (Cool. I trolled Brian Foy. All in fun, dude.)
No, you trolled brian d foy. Who is Brian Foy?
--
Marcel, Perl Padawan
sub AUTOLOAD{$_=$AUTOLOAD;s;.*::;;;y;_; ;;print}&Just_Another_Perl_Hacker;
------------------------------
Date: 2 Nov 1999 14:48:08 -0500
From: catfood@apk.net (Mark W. Schumann)
Subject: Re: What makes the web go?
Message-Id: <7vnf5o$3i2@junior.apk.net>
In article <mUQfOA2U0q22lfRZdm25XY0Xnt=w@4ax.com>,
Marcel Grunauer <marcel.grunauer@lovely.net> wrote:
>On 2 Nov 1999 08:08:37 -0500, catfood@apk.net (Mark W. Schumann)
>wrote:
>
>> Who the hell is this Brian Foy guy anyway? Read a FAQ once in a while,
>> kid.
>>
>> (Cool. I trolled Brian Foy. All in fun, dude.)
>
>No, you trolled brian d foy. Who is Brian Foy?
return 'Good one. You win.';
------------------------------
Date: Tue, 02 Nov 1999 19:38:48 GMT
From: mr_geek <shon@mad.scientist.com>
Subject: Re: Why can't I get this uniq/perl thing right?
Message-Id: <7vnek8$dh8$1@nnrp1.deja.com>
I just wanted to say thanks to all who helped me out with this problem.
Check earlier threads if you want to see exactly what.
Thanks Larry for your help. That is really fast code. I'm still not
quite sure how it does what it does though. I'm not really good with
hashes.
Thanks,
Shon
shon@mad.scientist.com
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
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 1256
**************************************