[24993] in Perl-Users-Digest
Perl-Users Digest, Issue: 7243 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Oct 14 03:07:05 2004
Date: Thu, 14 Oct 2004 00:05:09 -0700 (PDT)
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, 14 Oct 2004 Volume: 10 Number: 7243
Today's topics:
Re: [newbie] shtml question <dontmesswithme@got.it>
Re: [newbie] shtml question (David Efflandt)
Re: Concatenating an array into one string? <tadmc@augustmail.com>
Re: Concatenating an array into one string? <jurgenex@hotmail.com>
Re: Creating a random uniqie directory <bubbajeb@charter.net>
Getting Additional Perl Newsgroups <jkeen_via_google@yahoo.com>
Re: Getting Additional Perl Newsgroups <usa1@llenroc.ude.invalid>
Re: Getting Additional Perl Newsgroups <soundz@techie.com>
Re: Getting Additional Perl Newsgroups <tadmc@augustmail.com>
Re: Getting Additional Perl Newsgroups <usa1@llenroc.ude.invalid>
Re: Getting Additional Perl Newsgroups <dha@panix.com>
Re: hard references/arrays <mritty@gmail.com>
Re: How to package my perl scripts (that depend on othe <jkeen_via_google@yahoo.com>
How to show 'expiry page' when user click 'back' button <darick_ang@yahoo.com.sg>
Re: How to show 'expiry page' when user click 'back' bu <usa1@llenroc.ude.invalid>
Re: HTML::Parser and <p> behaviour? <bigal187@remove.rx.eastcoasttfc.com>
Re: HTML::Parser and <p> behaviour? <tadmc@augustmail.com>
Re: HTML::Parser and <p> behaviour? <tadmc@augustmail.com>
Re: HTML::Parser and <p> behaviour? <bigal187@removethis.rx.eastcoasttfc.com>
Re: HTML::Parser and <p> behaviour? <spambiat@yahoo.com>
Re: HTML::Parser and <p> behaviour? <bigal187@removethis.rx.eastcoasttfc.com>
Re: HTML::Parser and <p> behaviour? <dha@panix.com>
Re: HTML::Parser and <p> behaviour? <usa1@llenroc.ude.invalid>
Re: odd problem with open() <tadmc@augustmail.com>
Re: One liner to produce string of n '?'s separated by <octo@blueyonder.co.uk>
perl_parse() crashes with no apparent reason <jengelh@linux01.gwdg.de>
Re: QA frameworks with perl <jkeen_via_google@yahoo.com>
Re: Range lookup <jgibson@mail.arc.nasa.gov>
reading a zip from an IO::Scalar in 5.8 (Kevin)
Why it's good to be a "lazy" programmer <ineverreadanythingsenttome@hotmail.com>
Re: Why it's good to be a "lazy" programmer <bigiain@mightymedia.com.au>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 14 Oct 2004 01:47:40 GMT
From: Larry <dontmesswithme@got.it>
Subject: Re: [newbie] shtml question
Message-Id: <dontmesswithme-A4E582.03441314102004@twister2.tin.it>
In article <5aj042-rj5.ln1@osiris.mauzo.dyndns.org>,
Ben Morrow <usenet@morrow.me.uk> wrote:
> Idiot.
Mr. Ben Morrow , the idiot one is you.
------------------------------
Date: Thu, 14 Oct 2004 03:39:30 +0000 (UTC)
From: efflandt@xnet.com (David Efflandt)
Subject: Re: [newbie] shtml question
Message-Id: <slrncmrt7h.aj0.efflandt@typhoon.xnet.com>
On Wed, 13 Oct 2004 14:21:11 GMT, Larry <dontmesswithme@got.it> wrote:
> Hi folks!
>
> Maybe this has been covered before but I didn'd find anything helpful on
> google.
> I've a .shtml?k=1000 kind of page,here's the code:
>
> --
><html>
> <!-- #exec cgi="www.yousite.com/cgi-bin/page.cgi" -->
></html>
> --
Wrong newsgroup (not Perl specific), but there should NOT be a space in
<!--#exec (but a space before the trailing --> is proper). Read apache
docs about server side includes. That will also tell you that #exec
cgi= inherits the query string of the SSI page.
> Now, I'd like to pass the "k" value to "page.cgi" (before .shtml page
> being parsed by the server)
>
> Can It actually be done? (If not,I'll be in a mess!!!)
You just need to get the QUERY_STRING from the environment and properly
decode it, or use the Perl CGI module (perldoc CGI).
------------------------------
Date: Wed, 13 Oct 2004 19:07:15 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Concatenating an array into one string?
Message-Id: <slrncmrgpj.1me.tadmc@magna.augustmail.com>
Jürgen Exner <jurgenex@hotmail.com> wrote:
> Paul Robson wrote:
>> chomp($test[$i]);
>> $jobcat .= $test[$i];
>>
>> But it's not a neat "Perl" solution.
>
> Agree. A more perlish solution is
>
> chomp @test;
> $jobcat = join '', @test;
Or if you don't want to change @test's values:
$jobcat = join '', map { /(.*)/ } @test;
or
$jobcat = join '', map { substr $_, 0, -1 } @test; # better have newlines!
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Thu, 14 Oct 2004 03:54:00 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Concatenating an array into one string?
Message-Id: <sLmbd.3053$3Q.520@trnddc04>
Tad McClellan wrote:
> Jürgen Exner <jurgenex@hotmail.com> wrote:
>> Paul Robson wrote:
>>> chomp($test[$i]);
>>> $jobcat .= $test[$i];
>>>
>>> But it's not a neat "Perl" solution.
>>
>> Agree. A more perlish solution is
>>
>> chomp @test;
>> $jobcat = join '', @test;
>
> Or if you don't want to change @test's values:
>
> $jobcat = join '', map { /(.*)/ } @test;
> or
> $jobcat = join '', map { substr $_, 0, -1 } @test; # better have
> newlines!
Or (if you don't mind the added spaces)
$jobcat = "@test";
jue
------------------------------
Date: Thu, 14 Oct 2004 00:29:26 -0400
From: Jim Bunch <bubbajeb@charter.net>
Subject: Re: Creating a random uniqie directory
Message-Id: <10ms054rsbgok95@corp.supernews.com>
here's a snipit that creates a random directory:
#!/usr/bin/perl
TRYAGAIN:
$tmpdir=sprintf("Job%5.5d",rand(99999));
if( ! -e $tmpdir ){ mkdir($tmpdir,0755) }
else { go to TRYAGAIN };
print "Created directory: $tmpdir\n";
Jim
Jürgen Exner wrote:
> chris-usenet@roaima.co.uk wrote:
>
>>"Jürgen Exner" <jurgenex@hotmail.com> wrote:
>>
>>>Please see "perldoc -q temp":
>>
>>I'd argue that the determination of $temp_dir in that section's
>>example is wrong. Normal *IX approaches imply that $TMPDIR should
>>override the use of /tmp, whereas the example only considers $TMPDIR
>>if /tmp doesn't exist.
>
>
> Good catch! I agree, the way $temp_dir is determined
> my $temp_dir = -d '/tmp' ? '/tmp' : $ENV{TMP} || $ENV{TEMP};
> does not behave as most people would expect.
>
>
>>Is this a documentation "fault" and if so, is posting here sufficient?
>
>
> See "perldoc perlbug". You found it, the honors are yours.
>
> jue
>
>
------------------------------
Date: Thu, 14 Oct 2004 02:44:06 GMT
From: Jim Keenan <jkeen_via_google@yahoo.com>
Subject: Getting Additional Perl Newsgroups
Message-Id: <WJlbd.1210$6W6.315@trndny05>
My ISP's news server (news.verizon.net) distributes only a limited
number of Perl USENET news groups. In particular, they do not carry
perl.qa.
While I can follow this list via groups.google.com and, on a per message
basis, at nntp.perl.org, I would like to be able to follow this and even
more obscure lists as news, rather than as mail or thru a web interface.
Is there any way I can get such lists as news?
Thank you very much.
Jim Keenan
------------------------------
Date: 14 Oct 2004 03:40:30 GMT
From: "A. Sinan Unur" <usa1@llenroc.ude.invalid>
Subject: Re: Getting Additional Perl Newsgroups
Message-Id: <Xns9581F11D4112Fasu1cornelledu@132.236.56.8>
Jim Keenan <jkeen_via_google@yahoo.com> wrote in
news:WJlbd.1210$6W6.315@trndny05:
> My ISP's news server (news.verizon.net) distributes only a limited
> number of Perl USENET news groups. In particular, they do not carry
> perl.qa.
Am I missing something here? Why don't you add nntp.perl.org to your list
of news servers?
Sinan.
------------------------------
Date: Wed, 13 Oct 2004 20:44:12 -0700
From: Mark Day <soundz@techie.com>
Subject: Re: Getting Additional Perl Newsgroups
Message-Id: <416DF60C.1000306@techie.com>
Out fo curiosity, what heirarchy is per.qa on, alt.* comp.* or which one?
Thanks
Jim Keenan wrote:
> My ISP's news server (news.verizon.net) distributes only a limited
> number of Perl USENET news groups. In particular, they do not carry
> perl.qa.
>
> While I can follow this list via groups.google.com and, on a per message
> basis, at nntp.perl.org, I would like to be able to follow this and even
> more obscure lists as news, rather than as mail or thru a web interface.
>
> Is there any way I can get such lists as news?
>
> Thank you very much.
> Jim Keenan
------------------------------
Date: Wed, 13 Oct 2004 23:17:30 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Getting Additional Perl Newsgroups
Message-Id: <slrncmrveq.213.tadmc@magna.augustmail.com>
Jim Keenan <jkeen_via_google@yahoo.com> wrote:
> My ISP's news server (news.verizon.net) distributes only a limited
> number of Perl USENET news groups. In particular, they do not carry
> perl.qa.
Did you mean the "perl-qa" mailing list?
If so, then it is not a Usenet newsgroup, it is a mailing list.
If not, then where did you hear of the perl.qa newsgroup?
I cannot find any evidence of it.
> I would like to be able to follow this and even
> more obscure lists
But "this" is not a "list" (as in "mailing list") this is a
Usenet newsgroup.
> Is there any way I can get such lists as news?
There is a significant difference between a newsgroup and a
mailing list. Obscuring the difference by accessing them
the same way hides the difference yet further.
You can subscribe to perl-qa and have the same back-and-forth
as in newsgroups, but it will be via SMTP rather than NNTP.
What is your objection to simply subscribing to the mailing
lists that you want to participate in?
If you tell us the real problem you are trying to overcome,
we may be able to suggest how to overcome it. :-)
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: 14 Oct 2004 04:45:21 GMT
From: "A. Sinan Unur" <usa1@llenroc.ude.invalid>
Subject: Re: Getting Additional Perl Newsgroups
Message-Id: <Xns95827F6D29Casu1cornelledu@132.236.56.8>
Tad McClellan <tadmc@augustmail.com> wrote in
news:slrncmrveq.213.tadmc@magna.augustmail.com:
> Jim Keenan <jkeen_via_google@yahoo.com> wrote:
>> My ISP's news server (news.verizon.net) distributes only a limited
>> number of Perl USENET news groups. In particular, they do not carry
>> perl.qa.
>
>
> Did you mean the "perl-qa" mailing list?
>
> If so, then it is not a Usenet newsgroup, it is a mailing list.
>
> If not, then where did you hear of the perl.qa newsgroup?
>
> I cannot find any evidence of it.
Just FYI.
That was my first reaction as well. On closer inspection, however, there
seems to be some sort of mail-news gateway. Indeed, if you look at, say,
http://www.nntp.perl.org/group/perl.qa, there is a link titled:
read in newsreader
toward the top of the page. Clicking on that opened my newsreader which
then connected to nntp.perl.org and downloaded a newsrc file and finally
showed me all the messages for perl.qa. I did not try posting (for the
obvious reason that I did not have anything to say) but I have a feeling it
would work.
OTOH, clearly it would have been in the OP's interest to first have tried
that link.
This was a nice surprise to me as I do prefer my newsreader's interface to
the web based one as well.
Sinan.
------------------------------
Date: Thu, 14 Oct 2004 04:47:57 +0000 (UTC)
From: "David H. Adler" <dha@panix.com>
Subject: Re: Getting Additional Perl Newsgroups
Message-Id: <slrncms17t.r1o.dha@panix2.panix.com>
On 2004-10-14, Tad McClellan <tadmc@augustmail.com> wrote:
> Jim Keenan <jkeen_via_google@yahoo.com> wrote:
>> My ISP's news server (news.verizon.net) distributes only a limited
>> number of Perl USENET news groups. In particular, they do not carry
>> perl.qa.
>
>
> Did you mean the "perl-qa" mailing list?
>
> If so, then it is not a Usenet newsgroup, it is a mailing list.
>
> If not, then where did you hear of the perl.qa newsgroup?
>
> I cannot find any evidence of it.
One must keep in mind that the perl mailing lists tend to have a gateway
to usenettieness. Or not, I suppose. :-)
If one uses nntp.perl.org as one's news server, one can find these
mailing lists as newsgroups (which is probably the answer to Jim's
original question - point your newsreader at a different server). I
often find this kind of handy for lists that I only look at
occasionally.
dha
--
David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
Any country that has the words "play ball" in its national anthem
can't be all bad.
- Greg McCarroll
------------------------------
Date: Wed, 13 Oct 2004 21:37:07 -0400
From: Paul Lalli <mritty@gmail.com>
Subject: Re: hard references/arrays
Message-Id: <ckkl88$tkp$1@misc-cct.server.rpi.edu>
Ben Morrow wrote:
> Quoth "Paul Lalli" <mritty@gmail.com>:
>
>>{
>> local $, = "\n";
>> print @array1, @array2, @array3;
>>}
>>print "\n";
>
> {
> local ($,, $\) = ("\n", "\n");
> print @array1, @array2, @array3;
> }
I was waivering between those two and:
{
local $" = "\n";
print "@array1\n@array2\n@array3\n";
}
The one you mentioned is probably best. :)
Paul Lalli
------------------------------
Date: Thu, 14 Oct 2004 01:23:17 GMT
From: Jim Keenan <jkeen_via_google@yahoo.com>
Subject: Re: How to package my perl scripts (that depend on other utils)
Message-Id: <9ykbd.91$4V3.31@trndny01>
Markus Dehmann wrote:
> Hi,
>
> I have written a piece of software. It's some perl scripts and modules
> which depend on jconv, latex and some special latex packages.
>
> What is the best way to distribute such a thing? Just include jconv
> and the latex packages? Is there a suitable installation routine, or
> do I have write own installation scripts? Could I possibly use the
> perl packager (not sure what it is exactly).
>
> It should be as easy as possible for users to install on their
> machine.
>
Assuming it's for a *nix-like environment, have you considered writing
an rpm?
jimk
------------------------------
Date: Thu, 14 Oct 2004 09:45:26 +0800
From: Darick <darick_ang@yahoo.com.sg>
Subject: How to show 'expiry page' when user click 'back' button in browser ?
Message-Id: <gfmrm0p5gh2mucg4ddvra9tbb8nmie1ocf@4ax.com>
I face a problem when i try to develope a e-commerce program.
i want to show customer 'expiry page' when they try to click 'back'
button on the checkout page.
may i know how to do that ? i personally check the forum and try the
following command.
#!/usr/bin/perl
print "Content-type: text/html\n";
print "Pragma: no-cache\n";
print "Expires: -1\n";
print "Cache-Control: no-cache\n";
print "\n";
#### follow with the html body content
but seem like doesn't work. may i know can the above command support
dynamic page generated by perl cgi program ?
or support html file only ? can they support normal html file with or
without form entry ?
Please help me if anyone know the answer
------------------------------
Date: 14 Oct 2004 03:37:04 GMT
From: "A. Sinan Unur" <usa1@llenroc.ude.invalid>
Subject: Re: How to show 'expiry page' when user click 'back' button in browser ?
Message-Id: <Xns9581F08826A1Casu1cornelledu@132.236.56.8>
Darick <darick_ang@yahoo.com.sg> wrote in
news:gfmrm0p5gh2mucg4ddvra9tbb8nmie1ocf@4ax.com:
> I face a problem when i try to develope a e-commerce program.
>
> i want to show customer 'expiry page' when they try to click 'back'
> button on the checkout page.
> may i know how to do that ? i personally check the forum and try the
> following command.
What forum did you check?
> #!/usr/bin/perl
> print "Content-type: text/html\n";
> print "Pragma: no-cache\n";
> print "Expires: -1\n";
> print "Cache-Control: no-cache\n";
> print "\n";
> #### follow with the html body content
>
> but seem like doesn't work. may i know can the above command support
> dynamic page generated by perl cgi program ?
Your question has nothing to do with Perl. You should head on over to a CGI
group.
Sinan.
------------------------------
Date: Wed, 13 Oct 2004 19:06:43 -0700
From: "187" <bigal187@remove.rx.eastcoasttfc.com>
Subject: Re: HTML::Parser and <p> behaviour?
Message-Id: <2t656jF1seiq1U1@uni-berlin.de>
Tom wrote:
> 187 wrote:
[ snip unwarrented and non-sequitor drivel ]
FYI I've programming, working networks, IT, and help desks since the
80's. You know nothing of me. It's people like /you/ who can only
attempt to form an argument or rebuttal using personal attacks, and try
to bait fights.
I care not for you reply, as you have proven you have nothing of worth
to say. We do no need sheer hate being spread here.
------------------------------
Date: Wed, 13 Oct 2004 20:14:12 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: HTML::Parser and <p> behaviour?
Message-Id: <slrncmrkn4.1me.tadmc@magna.augustmail.com>
187 <bigal187@remove.rx.eastcoasttfc.com> wrote:
> A. Sinan Unur wrote:
>> Geoff Cox <geoff.cox@removethisplease.freeuk.com> wrote in
>> news:irtqm0lj618tedv6hsr8od6db5821b2h6b@4ax.com:
>>
>>> I cannot seem to work out how HTML::Parser deals with <p> text </p>
>>> from an html file ...
>>>
>>
>> Please read the posting guidelines posted here regularly.
>> So, go back and post a small, self-contained script that still
>> exhibits the problem.
>
> Grated soem sample code would of been nice,
More than nice. It nearly guarantees a useable answer.
It is in a poster's best interest to do what they can to get a
useable answer.
> Your assine tone, as well as your direct insults to the OP, was
> completely unwarrented.
I think you are lacking some pertinent information, and your
conclusion makes you look foolish.
> You could of just rplied asking for more information,
We have done this dozens of times for this OP.
We have asked this OP many times[1] to see the Posting Guidelines
if he wants the best chance at getting an answer.
There is a significant history here that you appear to be ignorant of.
> There is NO excuse for your tone in this thread.
There is NO excuse for acting like you know what has happened here
when you have not been here to see what is happening here, so:
*plonk*
You are speaking from ignorance. Mighty embarrassing in such
a public forum! Perhaps you should have waited until you could
followup on something that you actually know something about.
Geoff has proven a rather persistent disregard for the time
of other people. We are here only to serve his needs, so it
is no big deal if we have to work a little harder or ignore
his threads.
[1] Here are at least 6 such times:
http://groups.google.com/groups?as_q=%22Geoff%20Cox%22%20%22Posting%20Guidelines%22&as_ugroup=comp.lang.perl.misc
I get the feeling we are "talking to the hand" here...
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Wed, 13 Oct 2004 21:56:38 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: HTML::Parser and <p> behaviour?
Message-Id: <slrncmrqn6.1me.tadmc@magna.augustmail.com>
Geoff Cox <geoff.cox@removethisplease.freeuk.com> wrote:
> I cannot seem to work out how HTML::Parser deals with <p> text </p>
> It breaks up a paragraph by placing a </p> <p> inside a paragraph of
> text in what seems to me to be a random fashion...
If you show us your code, we might be able to help fix it.
Make a short and complete program *that we can run* that shows
this phantom "</p> <p>" thing, and we will explain to you
how it got there.
Why not follow the suggestions given in the Posting Guidelines?
If you had, the question would have been answered already instead
of another of your round-and-round threads where there is not
enough information given to be able to solve the problem.
Post a small program. We will fix it.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Wed, 13 Oct 2004 21:13:46 -0700
From: "187" <bigal187@removethis.rx.eastcoasttfc.com>
Subject: Re: HTML::Parser and <p> behaviour?
Message-Id: <2t6ck9F1rou9sU1@uni-berlin.de>
Tad McClellan wrote:
> 187 <bigal187@remove.rx.eastcoasttfc.com> wrote:
>> A. Sinan Unur wrote:
>>> Geoff Cox <geoff.cox@removethisplease.freeuk.com> wrote in
>>> news:irtqm0lj618tedv6hsr8od6db5821b2h6b@4ax.com:
>>>
>>>> I cannot seem to work out how HTML::Parser deals with <p> text </p>
>>>> from an html file ...
>>>>
>>>
>>> Please read the posting guidelines posted here regularly.
>
>
>>> So, go back and post a small, self-contained script that still
>>> exhibits the problem.
>>
>> Grated soem sample code would of been nice,
Sorry for my horrible typing. I've only had a total of 4 hours of sleep
the past week and a half :(
>
> More than nice. It nearly guarantees a useable answer.
>
> It is in a poster's best interest to do what they can to get a
> useable answer.
I fully agree. It just seemed to me like the OP at least tried to
explain his problem, though more in words and not so much in code.
I once again apologize if I got a little "off the deep end" back there.
------------------------------
Date: Wed, 13 Oct 2004 21:27:35 -0700
From: "Fred Canis" <spambiat@yahoo.com>
Subject: Re: HTML::Parser and <p> behaviour?
Message-Id: <ckkv2p$c2f$1@news.astound.net>
Tad McClellan wrote:
> 187 <bigal187@remove.rx.eastcoasttfc.com> wrote:
>> A. Sinan Unur wrote:
>>> Geoff Cox <geoff.cox@removethisplease.freeuk.com> wrote in
>>> news:irtqm0lj618tedv6hsr8od6db5821b2h6b@4ax.com:
>>>
>>>> I cannot seem to work out how HTML::Parser deals with <p> text </p>
>>>> from an html file ...
>>>>
>>>
>>> Please read the posting guidelines posted here regularly.
>
>
>>> So, go back and post a small, self-contained script that still
>>> exhibits the problem.
>>
>> Grated soem sample code would of been nice,
>
>
> More than nice. It nearly guarantees a useable answer.
>
> It is in a poster's best interest to do what they can to get a
> useable answer.
True.
>> Your assine tone, as well as your direct insults to the OP, was
>> completely unwarrented.
>
>
> I think you are lacking some pertinent information, and your
> conclusion makes you look foolish.
I beg to differ. The post in question here wasn't exactly blossoming
with positive vibes, and as such not likely to help the OP. Come on,
even you can surely admit this?
>> You could of just rplied asking for more information,
>
>
> We have done this dozens of times for this OP.
>
> We have asked this OP many times[1] to see the Posting Guidelines
> if he wants the best chance at getting an answer.
True, but most of which have bene clouded by the rather nagative vibes
there within.
> There is a significant history here that you appear to be ignorant of.
If you mean the history of the OP, well I think it's hardly fair to
exact everyone who posts or read here to keep track of the posting
histroy of every poster. It doesn't mean it couldn't be checked, of
course it could, but I do not think it right at all to give someone such
a thorough beating for missing one. I hardly think this is been such a
heinous offense.
>> There is NO excuse for your tone in this thread.
>
>
> There is NO excuse for acting like you know what has happened here
> when you have not been here to see what is happening here, so:
>
> *plonk*
Please don't start there. You and others can be great people with a
wealth of knowlege, but some of you are *way* too quick to puul the
plonk-trigger. I think what we have here is a mis understanding, at
least that's how I see it.
> You are speaking from ignorance. Mighty embarrassing in such
> a public forum! Perhaps you should have waited until you could
> followup on something that you actually know something about.
Again, I don't see the point of chastising a poster for not knowing the
posting history of every past poster in this group. It's almost absurd
to expect everyone to know. I regularly frequent this group, rarely
posting though, but a rather regular reader, and I too have missed what
ever incident this OP was apparently involved in.
Maybe best to let thread jsut die instead of going on so bitterly.
------------------------------
Date: Wed, 13 Oct 2004 21:41:31 -0700
From: "187" <bigal187@removethis.rx.eastcoasttfc.com>
Subject: Re: HTML::Parser and <p> behaviour?
Message-Id: <2t6e85F1rvlp5U1@uni-berlin.de>
Tad McClellan wrote:
> You are speaking from ignorance. Mighty embarrassing in such
> a public forum! Perhaps you should have waited until you could
> followup on something that you actually know something about.
>
> Geoff has proven a rather persistent disregard for the time
> of other people. We are here only to serve his needs, so it
> is no big deal if we have to work a little harder or ignore
> his threads.
I am sorry I did nto know this at first. I do not have time to keep
track of everything that goes on in the dozens of groups I suscribe in.
It seems illogical to me to exact everyone to automatically be aware of
any and all events. May I should go tosses the Op's name in google (and
set the group to this one.) I might of done jsut that if I wasn't in
such a rush.
I once again want to pologize for how I came out in this. I'm not a bad
person, I am in fact a tech as well. I love Perl and think it's the best
thing for programming since sliced bread, and that it's one of the most
intelligent language I've ver had the privilage to learn and become
proficient in. Before Perl I was just a C/C++ programmer doing mostly
freelance. I learned Perl and completely changed how I code many things
in shell/cgi/etc for both work and personal tasks.
I hope there are no hard feelings.
------------------------------
Date: Thu, 14 Oct 2004 04:59:37 +0000 (UTC)
From: "David H. Adler" <dha@panix.com>
Subject: Re: HTML::Parser and <p> behaviour?
Message-Id: <slrncms1to.r1o.dha@panix2.panix.com>
On 2004-10-14, Fred Canis <spambiat@yahoo.com> wrote:
> Tad McClellan wrote:
>
>> There is a significant history here that you appear to be ignorant of.
>
> If you mean the history of the OP, well I think it's hardly fair to
> exact everyone who posts or read here to keep track of the posting
> histroy of every poster. It doesn't mean it couldn't be checked, of
> course it could, but I do not think it right at all to give someone such
> a thorough beating for missing one. I hardly think this is been such a
> heinous offense.
I think tad's point is that if one is going to lambaste people for their
response to a poster, one might check whether there is some reason for
that response, rather than that one should check the posting history
relevant to any given thread.
dha
--
David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
You kids today have it easy. I remember when we had to write programs
with an ice pick and index cards. <Note: This joke is not Y2k
compliant. Soon people will ask, "What's an ice pick?"> - Lee Sharp
------------------------------
Date: 14 Oct 2004 05:15:36 GMT
From: "A. Sinan Unur" <usa1@llenroc.ude.invalid>
Subject: Re: HTML::Parser and <p> behaviour?
Message-Id: <Xns9582D1743172asu1cornelledu@132.236.56.8>
"187" <bigal187@removethis.rx.eastcoasttfc.com> wrote in
news:2t6e85F1rvlp5U1@uni-berlin.de:
> Tad McClellan wrote:
>
>> You are speaking from ignorance. Mighty embarrassing in such
>> a public forum! Perhaps you should have waited until you could
>> followup on something that you actually know something about.
>>
>> Geoff has proven a rather persistent disregard for the time
>> of other people. We are here only to serve his needs, so it
>> is no big deal if we have to work a little harder or ignore
>> his threads.
>
> I am sorry I did nto know this at first.
...
> I'm not a bad person, I am in fact a tech as well. I love Perl
Well, clearly. Why else would you read this group?
OTOH, I would think that someone who wishes to appear friendly might want
to avoid the nickname '187'.
As for my reaction to the OP, I find it particularly unproductive and
annoying to blame the package rather than look for an error in one's own
code. This was especially so since the OP provided no code of his own which
we could have looked at to test his assertion that the package was somehow
at fault.
Referring to the original post:
Geoff Cox <geoff.cox@removethisplease.freeuk.com> wrote in
news:irtqm0lj618tedv6hsr8od6db5821b2h6b@4ax.com:
> I cannot seem to work out how HTML::Parser deals with <p> text </p>
> from an html file ...
>
> It breaks up a paragraph by placing a </p> <p> inside a paragraph of
> text in what seems to me to be a random fashion...
The "It" in the second paragraph surely refers to HTML::Parser.
I stand by my belief that this is a "stupid" way to approach programming
problems. One should ask
+ Here is what I am doing
+ Here is what I would like to have happen
+ Instead, here is what is happening
+ What am I doing wrong?
Repeatedly ignoring this advice brings to mind the extremely apropos maxim
(I am probably misquoting this):
once is happenstance, twice coincidence, thrice is enemy action
and deserves a somewhat harsher than the usual mild reminder that the OP
read the posting guidelines.
Sinan.
------------------------------
Date: Wed, 13 Oct 2004 22:05:31 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: odd problem with open()
Message-Id: <slrncmrr7r.1me.tadmc@magna.augustmail.com>
Colin Howarth <colinDEL@howarth.de> wrote:
> open(FILE, "$dir/$file") or die "Can't open
> '$dir/$file': $!";
> This works fine except when it comes across a filename like
>
> /Library//CFMSupport/StuffItEngineShell.cfm/Icon^M
>
> i.e. where the last character is a CR, when the program dies.
>
> Now, I don't know why the odd file has a CR in it's name, but why
> doesn't open() work anyway?
The documentation for open() says why it is not working.
You must have missed it.
perldoc -f open
The filename passed to 2-argument (or 1-argument) form of open() will
have leading and trailing whitespace deleted,
...
Use 3-argument form to open a file with arbitrary weird characters in it,
> At present I've resorted to
>
> # chop $file if $file =~/\r$/;
> chop $file if substr($file, -1, 1) eq "\r";
And that makes it work?
If so, then the file does NOT have a CR in its name.
I thought you said above that it did have a CR in its name.
Which is it?
Anyway:
open(FILE, '<', "$dir/$file") or die...
will open() it even if CR is part of the filename.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Thu, 14 Oct 2004 02:26:05 GMT
From: Octo Mancer <octo@blueyonder.co.uk>
Subject: Re: One liner to produce string of n '?'s separated by commas ... ?
Message-Id: <pan.2004.10.14.02.20.50.725427@blueyonder.co.uk>
On Wed, 13 Oct 2004 17:03:58 +0000, Paul Lalli wrote:
> "Richard Gration" <richard@zync.co.uk> wrote in message
>> I think I will use Paul's solution. Cheers all
>
> Really? Personally I like Tad's better...
>
There's not much in it, I'd just rather avoid the extra block, my personal
aesthetic choice ...
------------------------------
Date: Thu, 14 Oct 2004 08:23:16 +0200
From: Jan Engelhardt <jengelh@linux01.gwdg.de>
Subject: perl_parse() crashes with no apparent reason
Message-Id: <Pine.LNX.4.53.0410140818370.7895@yvahk01.tjqt.qr>
Hello,
I have a super weird problem with embedding perl -- it crashes upon running
perl_parse(), but when in gdb, i must be luckily to get the sigsegv at all...
any idea?
GDB:
#0 0x402106ec in memcpy () from /lib/i686/libc.so.6
#1 0x400be26a in Perl_savepvn ()
from /usr/lib/perl5/5.8.0/i586-linux-thread-multi/CORE/libperl.so
#2 0x400ddc2e in Perl_sv_magicext ()
from /usr/lib/perl5/5.8.0/i586-linux-thread-multi/CORE/libperl.so
#3 0x400ddd9c in Perl_sv_magic ()
from /usr/lib/perl5/5.8.0/i586-linux-thread-multi/CORE/libperl.so
#4 0x400c2972 in Perl_mg_copy ()
from /usr/lib/perl5/5.8.0/i586-linux-thread-multi/CORE/libperl.so
#5 0x400c9a0c in Perl_hv_store_flags ()
from /usr/lib/perl5/5.8.0/i586-linux-thread-multi/CORE/libperl.so
#6 0x400c94c6 in Perl_hv_store ()
from /usr/lib/perl5/5.8.0/i586-linux-thread-multi/CORE/libperl.so
#7 0x40077c59 in S_init_postdump_symbols ()
from /usr/lib/perl5/5.8.0/i586-linux-thread-multi/CORE/libperl.so
#8 0x40073875 in S_parse_body ()
from /usr/lib/perl5/5.8.0/i586-linux-thread-multi/CORE/libperl.so
#9 0x40073169 in perl_parse ()
from /usr/lib/perl5/5.8.0/i586-linux-thread-multi/CORE/libperl.so
#10 0x0804ac60 in cnode_perl_init (cnode=0x40020330) at pg/gate.c:23
19 cnode->perl = my_perl = perl_alloc();
20 PERL_SET_CONTEXT(my_perl);
21 perl_construct(my_perl);
22 PL_exit_flags |= PERL_EXIT_DESTRUCT_END;
23>> perl_parse(my_perl, xs_init, 2, args, NULL);
24 perl_run(my_perl);
25 return;
(gdb) p args
$3 = {0x804be00 "-", 0x804be02 "sensors.pl", 0x0}
#11 0x0804ad0f in sensors_string (node=0x40020330) at pg/gate.c:41
#12 0x0804a74b in query_node (arg=0x40020330) at qd.c:67
#13 0x40044020 in pthread_start_thread () from /lib/i686/libpthread.so.0
#14 0x40044122 in pthread_start_thread_event () from /lib/i686/libpthread.so.0
Jan Engelhardt
--
Gesellschaft für Wissenschaftliche Datenverarbeitung
Am Fassberg, 37077 Göttingen, www.gwdg.de
------------------------------
Date: Thu, 14 Oct 2004 01:21:15 GMT
From: Jim Keenan <jkeen_via_google@yahoo.com>
Subject: Re: QA frameworks with perl
Message-Id: <fwkbd.89$4V3.64@trndny01>
Mark Day wrote:
> Can anyone point me to an on line tutorial regarding developing QA test
> harnesses and frameworks using perl. I am aware of some relevant modules
> on CPAN, but looking for a general overview, examples and introduction.
>
> Thanks in advance.
>
Start with what you probably already have:
perldoc Test::Tutorial
jimk
------------------------------
Date: Wed, 13 Oct 2004 18:31:12 -0700
From: Jim Gibson <jgibson@mail.arc.nasa.gov>
Subject: Re: Range lookup
Message-Id: <131020041831129083%jgibson@mail.arc.nasa.gov>
In article <slrncmqev6.37t.tadmc@magna.augustmail.com>, Tad McClellan
<tadmc@augustmail.com> wrote:
> Yash <yashgt@yahoo.com> wrote:
> > I have a set of ranges such as
> ><0.1%
>
>
> It will be a bit easier if you normalize the range representation:
>
> 0.0-0.1%
>
>
> > 0.1-0.2%
> > 0.2-0.3%
>
>
> Errr, so which one of those ranges is 0.2 supposed to be in?
>
>
> > and I have to identify the range that contains an input value such as
> > 1.25. The above set of ranges is not fixed and is configurable in a
> > text file.
If your ranges are contiguous, as in the example shown, then you only
need to store the dividing values:
0.0
0.1
0.2
etc.
and the best data structure will be a simple array of scalars. Then,
assuming that a value equal to one of the dividing values belongs in
the upper range, Tad's suggested program can be changed thusly, where
the range 0 indicates the value is less than the lowest range and you
will have one more ranges than you have dividing values:
#!/usr/local/bin/perl
use warnings;
use strict;
my @boundaries = <DATA>;
chomp @boundaries;
my $num = 1.25;
my $bin = in_range($num);
if( $bin > 0 ) {
if( $bin > $#boundaries ) {
print "$num is in range $bin: $boundaries[$bin-1] and up\n";
}else{
print "$num is in range $bin: $boundaries[$bin-1] -
$boundaries[$bin]\n";
}
}else{
print "$num is in range $bin: < $boundaries[$bin]\n";
}
sub in_range {
my($n) = @_;
foreach my $i ( 0 .. $#boundaries ) {
return $i if $num < $boundaries[$i];
}
return $#boundaries+1;
}
__DATA__
0.0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1.0
1.5
2.0
2.5
3
20
30
40
___END__
If the number of ranges is large and you are trying to squeeze out all
efficiency possible, you can change in_range to use a binary search:
sub binary_in_range {
my $n = shift;
my $lo = 0;
my $hi = $#boundaries;
while( $lo < $hi ) {
my $mid = int(($lo + $hi)/2);
if( $n < $boundaries[$mid] ) {
$hi = $mid - 1;
}else{
$lo = $mid + 1;
}
}
return ($n < $boundaries[$lo] ) ? $lo : $lo + 1;
}
------------------------------
Date: 13 Oct 2004 21:54:48 -0700
From: bakdong@hotmail.com (Kevin)
Subject: reading a zip from an IO::Scalar in 5.8
Message-Id: <881fed67.0410132054.32ae31e5@posting.google.com>
perl, v5.8.3
Archive-Zip-1.13
How do I need to change the code given in the Archive::Zip examples
directory to make it work with perl 5.8? It works ok on machines with
5.6 and I'm assuming that it's a problem caused by changes in 5.8.
When I try to run the readScalar.pl code I get:
Read 20000 bytes
error: file not seekable
Archive::Zip::Archive::readFromFileHandle('Archive::Zip::Archive=HASH(0x92ebd98)','IO::Scalar=GLOB(0x90de7d4)')
called at ./readScalar.pl line 20
(this is the code):
#!/usr/bin/perl -w
# Demonstrates reading a zip from an IO::Scalar
# $Revision: 1.4 $
use strict;
use Archive::Zip qw(:CONSTANTS :ERROR_CODES);
use IO::Scalar;
use IO::File;
# test reading from a scalar
my $file = IO::File->new('testin.zip', 'r');
my $zipContents;
binmode($file);
$file->read($zipContents, 20000);
$file->close();
printf "Read %d bytes\n", length($zipContents);
my $SH = IO::Scalar->new(\$zipContents);
my $zip = Archive::Zip->new();
$zip->readFromFileHandle( $SH );
my $member = $zip->addString('c' x 300, 'bunchOfCs.txt');
$member->desiredCompressionMethod(COMPRESSION_DEFLATED);
$member = $zip->addString('d' x 300, 'bunchOfDs.txt');
$member->desiredCompressionMethod(COMPRESSION_DEFLATED);
$zip->writeToFileNamed('test2.zip');
------------------------------
Date: Wed, 13 Oct 2004 23:48:37 -0700
From: "David Filmer" <ineverreadanythingsenttome@hotmail.com>
Subject: Why it's good to be a "lazy" programmer
Message-Id: <8PWdnWt1JvrbvPPcRVn-tQ@comcast.com>
Years ago, I read the musings of one of the "great Perl gurus" (I believe it
was Larry himself, though it might have been Randal or Tom or maybe somebody
else) who described several good reasons that laziness was a virtue among
programmers (when "laziness" is viewed in the proper perspective, of
course!). I wanted to revisit this topic, but unfortunately I don't remember
exactly where I read this, and I don't reacll enough of the content to
construct an effective Google search. Can somebody point me in the right
direction?
Thx!
------------------------------
Date: Thu, 14 Oct 2004 17:05:11 +1000
From: Iain Chalmers <bigiain@mightymedia.com.au>
Subject: Re: Why it's good to be a "lazy" programmer
Message-Id: <bigiain-EA8571.17051114102004@individual.net>
In article <8PWdnWt1JvrbvPPcRVn-tQ@comcast.com>,
"David Filmer" <ineverreadanythingsenttome@hotmail.com> wrote:
> Years ago, I read the musings of one of the "great Perl gurus" (I believe it
> was Larry himself, though it might have been Randal or Tom or maybe somebody
> else) who described several good reasons that laziness was a virtue among
> programmers (when "laziness" is viewed in the proper perspective, of
> course!). I wanted to revisit this topic, but unfortunately I don't remember
> exactly where I read this, and I don't reacll enough of the content to
> construct an effective Google search. Can somebody point me in the right
> direction?
I suspect googling for "laziness impatience and hubris" will find what
you recall...
like this:
http://c2.com/cgi/wiki?LazinessImpatienceHubris
cheers,
big
--
"I say we take off and nuke the entire site from orbit.
It's the only way to be sure." - Ellen Ripley
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
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 V10 Issue 7243
***************************************