[25746] in Perl-Users-Digest
Perl-Users Digest, Issue: 7986 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Apr 18 03:05:33 2005
Date: Mon, 18 Apr 2005 00:05:13 -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 Mon, 18 Apr 2005 Volume: 10 Number: 7986
Today's topics:
Re: can anyone explain the last two lines to me?thanks! <joe@inwap.com>
Re: Creating m3u list from opendir listing axel@white-eagle.invalid.uk
Re: Creating m3u list from opendir listing <spamtrap@dot-app.org>
Re: Creating m3u list from opendir listing axel@white-eagle.invalid.uk
Re: Creating m3u list from opendir listing <spamtrap@dot-app.org>
Re: Do You Want To Know For Sure That You Are Going To <jurgenex@hotmail.com>
Re: File::Find - following s'linked directories? <joe@inwap.com>
Re: Is Perl open source? <dha@panix.com>
Re: Is Perl open source? <none@none>
Re: memory leak in loop <sisyphus1@nomail.afraid.org>
Re: outputting the results of something.pl <flavell@ph.gla.ac.uk>
Re: outputting the results of something.pl <tadmc@augustmail.com>
Re: outputting the results of something.pl <joe@inwap.com>
Re: Perl HTML::TableExtract Question <none@none>
Regexp optimization <sravi.in@gmail.com>
what is .3pm extension <TechCrazy@hotpop.com>
Re: what is .3pm extension axel@white-eagle.invalid.uk
Re: what is .3pm extension <spamtrap@dot-app.org>
Re: what is .3pm extension <mark.clementsREMOVETHIS@wanadoo.fr>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sun, 17 Apr 2005 20:27:45 -0700
From: Joe Smith <joe@inwap.com>
Subject: Re: can anyone explain the last two lines to me?thanks!
Message-Id: <ROmdnVekN4yutP7fRVn-rg@comcast.com>
A. Sinan Unur wrote:
> biomahui@gmail.com wrote in news:1113437685.686265.96980
> @f14g2000cwb.googlegroups.com:
>
>>... is hui. Google doesn't show it for purpose.
>
> Huh?
The OP is referring to the misfeature on http://groups-beta.google.com
in which ' b i o m a h u i @ g m a i l . c o m ' is displayed
as 'bioma...@gmail.com'. He or she is assuming that everyone
reads USENET newsgroups via a web interface where context can be
found on the screen one inch above the reply.
http://groups-beta.google.com/group/comp.lang.perl.misc/browse_frm/thread/8b03f848d20faaaa/618250eaa4dd1bc1
------------------------------
Date: Sun, 17 Apr 2005 23:37:49 -0500
From: axel@white-eagle.invalid.uk
Subject: Re: Creating m3u list from opendir listing
Message-Id: <6fOdne0V6uIApP7fRVn-pg@adelphia.com>
Seansan <sheukels=cuthere=@yahooo.co.uk> wrote:
> Does anyone know why the following code doenst force a download of a m3u
> list (winamp playlist) when called directly? Am I forgetting something?
I think there is a typo...
> print "Content-type: application/octet-stream\n";
> print "Content-Disposition: attachment; filename=mymusic.m3u\n";
> print "Content-Length: ", length $body, "\n\n",
^^^^
should be ;
> print $body;
Axel
------------------------------
Date: Mon, 18 Apr 2005 00:59:55 -0400
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: Creating m3u list from opendir listing
Message-Id: <ismdnc_7Ka1Wo_7fRVn-vQ@adelphia.com>
Seansan wrote:
> Does anyone know why the following code doenst force a download of a m3u
> list (winamp playlist) when called directly? Am I forgetting something?
Others have already pointed out the errors in your Perl - it's obviously
not your real code. It won't even compile.
Anyway... Your question is about HTTP headers and web browsers. It
really has nothing to do with Perl. You're asking *what* to print, not
how to print, so the fact that you happen to be printing with Perl is
incidental.
For the sort of question you're asking, you'd get more and better advice
by posting to a group that's focused on CGI programming for the WWW -
for instance, comp.infosystems.www.authoring.cgi might be a good choice.
sherm--
--
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org
------------------------------
Date: Mon, 18 Apr 2005 00:06:42 -0500
From: axel@white-eagle.invalid.uk
Subject: Re: Creating m3u list from opendir listing
Message-Id: <B76dnSJ0LuD_3f7fRVn-sw@adelphia.com>
Sherm Pendley <spamtrap@dot-app.org> wrote:
> Seansan wrote:
>> Does anyone know why the following code doenst force a download of a m3u
>> list (winamp playlist) when called directly? Am I forgetting something?
> Others have already pointed out the errors in your Perl - it's obviously
> not your real code. It won't even compile.
To be fair... it does compile.
Axel
------------------------------
Date: Mon, 18 Apr 2005 01:39:19 -0400
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: Creating m3u list from opendir listing
Message-Id: <FPGdnaLMnYmU1f7fRVn-2g@adelphia.com>
axel@white-eagle.invalid.uk wrote:
> To be fair... it does compile.
Okay, I thought the typo you pointed out earlier would have prevented
it. Even so, it does cause an error in the output. With the misplaced
comma, it triggers a "500 Server Error". With that corrected, my default
browser (Safari) downloads the file and saves it with the suggested
name. FireFox pops up a "do you want to open or save this file?" dialog.
Clearly, the question concerns the state of browser support for these
HTTP headers. That's a question that has nothing to do with the language
you happen to be using to print them.
I'm not just pointing this out to be picky, either - like I said, I
believe the OP will get more and better advice from a group where just
this sort of question is the main focus.
sherm--
--
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org
------------------------------
Date: Mon, 18 Apr 2005 06:28:33 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Do You Want To Know For Sure That You Are Going To Heaven? The reason some people don't know for sure if they are going to Heaven when they die is because they just don't know. The good news is that you can know for sure that you are going to Heaven wh
Message-Id: <lsI8e.65205$B12.28903@trnddc09>
RonGrossi382658@yahoo.com wrote:
> The reason some people don't know for sure
> if they are going to Heaven
Do you want to know for sure that you are going to Hell?
Just keep spamming and you will....
jue
------------------------------
Date: Sun, 17 Apr 2005 20:39:38 -0700
From: Joe Smith <joe@inwap.com>
Subject: Re: File::Find - following s'linked directories?
Message-Id: <FIydnSxF7Ldjtv7fRVn-qw@comcast.com>
Peter Ensch wrote:
> Why doesn't this follow symbolically linked directories like the
> unix find command used to create it does?
The Unix 'find' command does not follow symbolically linked
directories unless "-follow" is explicitly requested.
File::Find has a similar feature, but also has to be
explicitly requested.
-Joe
------------------------------
Date: Sun, 17 Apr 2005 23:09:17 +0000 (UTC)
From: "David H. Adler" <dha@panix.com>
Subject: Re: Is Perl open source?
Message-Id: <slrnd65r4s.h40.dha@panix2.panix.com>
On 2005-04-17, Chris Mattern <matternc@comcast.net> wrote:
> brian d foy wrote:
>
>> In article <slrnd633e8.1am.tassilo.von.parseval@localhost.localdomain>,
>> Tassilo v. Parseval <tassilo.von.parseval@rwth-aachen.de> wrote:
>>
>>> Also sprach brian d foy:
>>> > In article <ctednT0c5q66nsLfRVn-3w@comcast.com>, Chris Mattern
>>> ><matternc@comcast.net> wrote:
>>
>>> >> I did say *often*, not *always*. Of course, anybody doing tasks
>>> >> with hard real-time requirements in Perl is certifiable.
>>
>>> > Certifiably what? I do things with hard real-time requirements
>>> > in Perl.
>>
>>> I strongly doubt that. Perl is inherently unsuitable for those kind of
>>> tasks. Most languages and environments in fact are.
>>
>> Maybe someone should define some terms then, because we haven't
>> talked about anything specific, but everyone seems to think we're
>> talking about something specific. :)
>>
> We are talking about something specific. Hard real time programming
> is programming in an environment with exact and rigorous timing
> requirements (like setting off an airbag).
And you can do that with perl under some circumstances. Your definition
does not contain the phrase "it must be fast" in it.
Now, since everyone here knows what the heck they're talking about, can
we stop picking nits? Or at least can we start paying attention when
people use smileys?
I should point out that I say this as someone who spends most of his
time picking nits. But I do it for fun, which this really isn't anymore.
dha
--
David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
Riding around on a horse while wearing a loincloth with one's gut
flapping in the breeze for a rock & roll video may lead viewers to
believe said rider to be, if not Indian, merely insane. That confusion
is understandable too. - Rip Thrillby
------------------------------
Date: Mon, 18 Apr 2005 10:50:59 +1000
From: Paul <none@none>
Subject: Re: Is Perl open source?
Message-Id: <42630473$0$5597$afc38c87@news.optusnet.com.au>
David H. Adler wrote:
> On 2005-04-17, Chris Mattern <matternc@comcast.net> wrote:
>
>>brian d foy wrote:
>>
>>
>>>In article <slrnd633e8.1am.tassilo.von.parseval@localhost.localdomain>,
>>>Tassilo v. Parseval <tassilo.von.parseval@rwth-aachen.de> wrote:
>>>
>>>
>>>>Also sprach brian d foy:
>>>>
>>>>>In article <ctednT0c5q66nsLfRVn-3w@comcast.com>, Chris Mattern
>>>>><matternc@comcast.net> wrote:
>>>
>>>>>>I did say *often*, not *always*. Of course, anybody doing tasks
>>>>>>with hard real-time requirements in Perl is certifiable.
>>>
>>>>>Certifiably what? I do things with hard real-time requirements
>>>>>in Perl.
>>>
>>>>I strongly doubt that. Perl is inherently unsuitable for those kind of
>>>>tasks. Most languages and environments in fact are.
>>>
>>>Maybe someone should define some terms then, because we haven't
>>>talked about anything specific, but everyone seems to think we're
>>>talking about something specific. :)
>>>
>>
>>We are talking about something specific. Hard real time programming
>>is programming in an environment with exact and rigorous timing
>>requirements (like setting off an airbag).
>
>
> And you can do that with perl under some circumstances. Your definition
> does not contain the phrase "it must be fast" in it.
>
> Now, since everyone here knows what the heck they're talking about, can
> we stop picking nits? Or at least can we start paying attention when
> people use smileys?
>
> I should point out that I say this as someone who spends most of his
> time picking nits. But I do it for fun, which this really isn't anymore.
>
> dha
>
The correct definition of real-time is "that the processing must be done
in time to affect its input".
A typical example ( used in most classrooms ) is that of a valve
controlling water flow to, say a turbine. If the measurement and
calculation of adjustrments is not made "in real time" the output could
cause the input to overshoot.
The term real-time is very badly used - I once heard a guy refer to a
network as "real-time" - a definite no-no.
------------------------------
Date: Mon, 18 Apr 2005 11:54:40 +1000
From: "Sisyphus" <sisyphus1@nomail.afraid.org>
Subject: Re: memory leak in loop
Message-Id: <42631350$0$8365$afc38c87@news.optusnet.com.au>
"Mike Solomon" <mike_solomon@lineone.net> wrote in message
news:56568be5.0504170952.43c93c7a@posting.google.com...
> "Sisyphus" <sisyphus1@nomail.afraid.org> wrote in message
news:<42606ee2$0$5394$afc38c87@news.optusnet.com.au>...
> > That module has not been updated on cpan in over 9 years. Maybe try
using
> > DBD::Xbase instead. (It's available as a ppm from ActiveState.)
> >
> > Cheers,
> > Rob
>
>
> Same problem with DBD:Xbase I'm afraid
Bummer ..... I guess the problem arises because you call new() at each
iteration. Do you need to do that ? Does it make any difference if you
'undef($dbh);' at the end of the loop (just after '$dbh->close;') ? Other
than that, if there's no help forthcoming, I would try contacting the
author - in fact it would be a good idea to let him know of the problem,
anyway.
Cheers,
Rob
------------------------------
Date: Sun, 17 Apr 2005 23:17:08 +0100
From: "Alan J. Flavell" <flavell@ph.gla.ac.uk>
Subject: Re: outputting the results of something.pl
Message-Id: <Pine.LNX.4.61.0504172307550.14739@ppepc56.ph.gla.ac.uk>
On Sun, 17 Apr 2005, jim jowski wrote:
[excessive quotage snipped]
> I was able to get the output of 'something.pl' to display by
> changing it to:
>
> #!/usr/bin/perl
A pity that you offer indirect thanks to Tad, while apparently
ignoring his oft-repeated advice...[1]
> use CGI;
> $query = new CGI;
wibble
> @names = $query->param; #the names of the passed parameters
> $dollar0 = $query->param('v0');
> $dollar1 = $query->param('v1');
> $dollar2 = $query->param('v2');
>
> print "Content-type: text/html\n\n";
> print "<HTML><HEAD><TITLE>the TITLE</TITLE></HEAD>\n\n<BODY>";
Talk about getting a dog and barking for yourself...
CGI.pm is happy to generate this correctly for you (in xhtml or html
flavours at your option).
Omitting the appropriate charset specification from the Content-type:
header can have some unpleasant consequences when handling forms
input. It's also a security exposure according to CA-2000-02 (a
rather complex bag of stuff, but the advice in this regard was clear
enough).
> "Content-..." line with two newlines made the header legal.
Well, yes, as far as *that* went.
> Thanks again to all, especially Tad McClellan, for the gentle
> guidance in the right direction.
[1] But you still didn't take the advice that's churned out here
countless times a day, to ask Perl for all the help it can give.
Which means using strict, and (at least during development) using
warnings. And in the case of CGI one should make taint checking (-T)
one's default.
------------------------------
Date: Sun, 17 Apr 2005 15:49:18 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: outputting the results of something.pl
Message-Id: <slrnd65iue.aj.tadmc@magna.augustmail.com>
jim jowski <backhaul14@sbcglobal.net> wrote:
> Tad McClellan wrote:
>> jim jowski <backhaul14@sbcglobal.net> wrote:
>>>$dollar0 = @ARGV[0];
>> CGI programs do not normally get command line arguments.
>> You should use the CGI.pm module to get access to the form values.
> Actually, the problem is one of making the form available
> At least I'm heading down the right path regarding getting the output
> but now passing the input is the problem.
CGI programs do not normally get command line arguments.
You should use the CGI.pm module to get access to the form values.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Sun, 17 Apr 2005 19:21:52 -0700
From: Joe Smith <joe@inwap.com>
Subject: Re: outputting the results of something.pl
Message-Id: <TtGdnWM9D7hchP7fRVn-vQ@comcast.com>
John wrote:
> Maybe you need to backquote or escape-out the slashes in your literal
No, jim's problem has nothing to do with slashes.
------------------------------
Date: Mon, 18 Apr 2005 08:57:33 +1000
From: Paul <none@none>
Subject: Re: Perl HTML::TableExtract Question
Message-Id: <4262e9dd$0$2401$afc38c87@news.optusnet.com.au>
Tad McClellan wrote:
> Paul <none@none> wrote:
>
>
>>What I want is the field from the top table Labelled - "Tot. Shares Out."
>
>
>>my $te = HTML::TableExtract->new( headers => [ 'Fundamental Data', '*' ]);
>
>
>
> The headers approach will not work since there are no headers
> on the table that contains the data that you are after.
>
>
>
>>"How do I get an
>>un-labelled column ????"
>
>
>
> Positionally.
>
> "Tot. Shares Out." is the 7th column in the 12th row of the table
> at depth=2 and count=1.
>
>
>
>>Any help would be appreciated.
>
>
>
> my $te = HTML::TableExtract->new( depth => 2, count => 1);
> my $total_outstanding = ($ts->rows)[11]->[6];
>
>
Thanks for that Tad !! I got the same answer at about 0230 in the
morning :-(
It seems the page isn't very well constructed.
I spent lots of time looking for the new version of HTML::TableExtract
which is supposed to address rows as well as columns but could only find
fleeting references to it.
Regards.
------------------------------
Date: 17 Apr 2005 22:53:00 -0700
From: "sravi" <sravi.in@gmail.com>
Subject: Regexp optimization
Message-Id: <1113803580.450308.134370@o13g2000cwo.googlegroups.com>
I have the following piece of code,
#-----------------------
my $sd = '(\d{8})\s+(\d\d:\d\d:\d\d)';
my $ed = '(\d{8}|-1)\s+(\d\d:\d\d:\d\d|-1)';
my $up_com = '^#?(\S+)\s*(\S+)\s*'."$startDateRegex\$";
my $regex = "([+#-]?)\s*$sd\\s+$ed\\s+(\\S+)\\s+(\\S+)\\s+(.+)";
while (<>) {
if (/$regex/o) {
my @line =
($1, $2, $3, $4, $5, $6, $7, $8);
# Process the data and print
}
elsif (/$up_com/o) {
my ($a,$b,$c) = ($2,$3,$4);
# Process the data and print
}
else {
print;
}
}
#-----------------------
I have two regex that can match the given line. Is it possible to
combine first and second regex into one regex and process the data
optimally?
------------------------------
Date: 17 Apr 2005 23:34:17 -0700
From: "TechCrazy" <TechCrazy@hotpop.com>
Subject: what is .3pm extension
Message-Id: <1113806057.087819.70430@l41g2000cwc.googlegroups.com>
Hi, I am new to Perl. What are the files with .3pm extension? I know
that files with .pm extension are perl modules.
I have a file Tangram::Set.3pm in my perl packages directory.
$ file Tangram\:\:Set.3pm
Tangram::Set.3pm: troff or preprocessor input text
How do I view the contents of this file? Looks like there is code and
docs inside this file?
I have googling around for 30 minutes now. Haven't found anything yet.
Maybe, I am looking at the wrong places. I unsuccessfully tried all the
possible options with man as well:
517 man Tangram::Set.3pm
518 man -M .Tangram::Set.3pm
519 man -m .Tangram::Set.3pm
520 MANPATH=. man Tangram::Set.3pm
521 MANPATH=. man Tangram::Set.3pm
533 man Tangram::Scalar.3pm
534 man < Tangram::Scalar.3pm
535 man -M . < Tangram::Scalar.3pm
537 man -t Tangram::Scalar.3pm
538 man -t -M . Tangram::Scalar.3pm
539 man -t -M . Tangram::Scalar
540 man -t -M . Tangram
541 man -t -M . Scalar
------------------------------
Date: Mon, 18 Apr 2005 01:53:38 -0500
From: axel@white-eagle.invalid.uk
Subject: Re: what is .3pm extension
Message-Id: <kfidnXtUvYLvxP7fRVn-gw@adelphia.com>
TechCrazy <TechCrazy@hotpop.com> wrote:
> Hi, I am new to Perl. What are the files with .3pm extension? I know
> that files with .pm extension are perl modules.
> I have a file Tangram::Set.3pm in my perl packages directory.
>
> $ file Tangram\:\:Set.3pm
> Tangram::Set.3pm: troff or preprocessor input text
> How do I view the contents of this file? Looks like there is code and
> docs inside this file?
It is most likely a manual page.
Try from the command line:
nroff -man Tangram::Set.3pm | less
Axel
------------------------------
Date: Mon, 18 Apr 2005 03:01:03 -0400
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: what is .3pm extension
Message-Id: <FIGdnZlSGNitxv7fRVn-iw@adelphia.com>
TechCrazy wrote:
> Hi, I am new to Perl. What are the files with .3pm extension?
Man pages that have been produced with pod2man.
> I have a file Tangram::Set.3pm in my perl packages directory.
...
> How do I view the contents of this file?
Well, for one thing they're no different from what you'd get with
"perldoc Tangram::Set". But if you prefer man pages for some reason,
just copy the file to wherever your other Perlish man pages live -
likely either /usr/local/share/man/man3 or /usr/share/man/man3.
The "make install" step of the module installation should have already
done that for you, however. It might be worth wondering why it didn't.
sherm--
--
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org
------------------------------
Date: Mon, 18 Apr 2005 09:04:08 +0200
From: Mark Clements <mark.clementsREMOVETHIS@wanadoo.fr>
Subject: Re: what is .3pm extension
Message-Id: <42635be9$0$25045$8fcfb975@news.wanadoo.fr>
TechCrazy wrote:
> Hi, I am new to Perl. What are the files with .3pm extension? I know
> that files with .pm extension are perl modules.
>
> I have a file Tangram::Set.3pm in my perl packages directory.
>
> $ file Tangram\:\:Set.3pm
> Tangram::Set.3pm: troff or preprocessor input text
>
> How do I view the contents of this file? Looks like there is code and
> docs inside this file?
>
> I have googling around for 30 minutes now. Haven't found anything yet.
> Maybe, I am looking at the wrong places. I unsuccessfully tried all the
> possible options with man as well:
>
> 517 man Tangram::Set.3pm
> 518 man -M .Tangram::Set.3pm
> 519 man -m .Tangram::Set.3pm
> 520 MANPATH=. man Tangram::Set.3pm
> 521 MANPATH=. man Tangram::Set.3pm
> 533 man Tangram::Scalar.3pm
> 534 man < Tangram::Scalar.3pm
> 535 man -M . < Tangram::Scalar.3pm
> 537 man -t Tangram::Scalar.3pm
> 538 man -t -M . Tangram::Scalar.3pm
> 539 man -t -M . Tangram::Scalar
> 540 man -t -M . Tangram
> 541 man -t -M . Scalar
>
MANPATH or the argument to -M need to be set to the notional top-level
of the man structure you want to read from (ie the directory in which
one finds man1, man3 etc). You can use strace/truss (eg on
Linux/Solaris) to work out exactly what files man is trying to open.
3pm in this case means that the file is a manfile in section 3pm, "pm"
standing for "perl modules", though this convention appears to have
fallen out of use.
Note that manfiles can normally just be processed with nroff if all else
fails eg:
nroff -man blib/man3/Tangram::Set.3 | less
Also note that I can't find any .3pm files in the latest version of
Tangram; is your installation out of date?
Mark
------------------------------
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 7986
***************************************