[24257] in Perl-Users-Digest
Perl-Users Digest, Issue: 6448 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Apr 22 21:05:48 2004
Date: Thu, 22 Apr 2004 18:05:14 -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, 22 Apr 2004 Volume: 10 Number: 6448
Today's topics:
Re: Asking for comments on this script <edwards@nouce.trurl.bsd.uchicago.edu>
Re: Asking for comments on this script <Jon.Ericson@jpl.nasa.gov>
Re: cgi.pm <robin @ infusedlight.net>
Re: cgi.pm <spamtrap@dot-app.org>
Correct use of Unicode in RegExp <mike@mysurname.co.uk>
Re: free source guestbook (finished) <robin @ infusedlight.net>
Re: free source guestbook (finished) <robin @ infusedlight.net>
Re: Huffman coding and Parse::RecDescent <uri.guttman@fmr.com>
Re: Huffman coding and Parse::RecDescent <Jon.Ericson@jpl.nasa.gov>
I know, I know, I don't know <andries@zilz.nl>
Re: I know, I know, I don't know <mike@mysurname.co.uk>
Re: I know, I know, I don't know <robin @ infusedlight.net>
March your way into the weekend! <kengineering@peoplepc.com>
Re: Operator overloading <kalinaubears@iinet.net.au>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 23 Apr 2004 00:02:47 GMT
From: Darrin Edwards <edwards@nouce.trurl.bsd.uchicago.edu>
Subject: Re: Asking for comments on this script
Message-Id: <slrnc8gn97.ap3.edwards@trurl.bsd.uchicago.edu>
In article <rcgd65zeoa2.fsf@Jon-Ericson.sdsio.prv>, Jon Ericson wrote:
> Rafael Villarroel Flores <rvf_lists@fastmail.fm> writes:
[OP describing a perl script to output latex]
Wow, I thought I was crazy trying to combine perl + latex, guess I am
not the only one. :)
(My attempts, not for the weak-stomached:
http://home.uchicago.edu/~dcedward/software/)
> This seems like an excellent opportunity to use PerlTeX[2].
> [2] Available at www.ctan.org (note the `t').
I _really_ want to thank you for mentioning this. I've been dreaming
of such a thing for years, and had no idea someone else not only had
the same itch, but had successfully scratched it so to speak.
Thanks again!
--
Darrin
------------------------------
Date: Thu, 22 Apr 2004 17:42:22 -0700
From: Jon Ericson <Jon.Ericson@jpl.nasa.gov>
Subject: Re: Asking for comments on this script
Message-Id: <rcgisfrcyoh.fsf@Jon-Ericson.sdsio.prv>
Darrin Edwards <edwards@nouce.trurl.bsd.uchicago.edu> writes:
> I _really_ want to thank you for mentioning this. I've been
> dreaming of such a thing for years, and had no idea someone else not
> only had the same itch, but had successfully scratched it so to
> speak.
Don't thank me. Thank Scott Pakin, who wrote PerlTeX.
Jon
------------------------------
Date: Thu, 22 Apr 2004 17:25:34 -0700
From: "Robin" <robin @ infusedlight.net>
Subject: Re: cgi.pm
Message-Id: <c69p2b$j4p$3@reader2.nmix.net>
"Clyde Ingram"
<clydenospamorham@nospamorhamgetofftheline.freeservenospamorham.co.uk> wrote
in message news:mZThc.2$O_.0@newsfe5-gui.server.ntli.net...
>
> "Robin" <robin @ infusedlight.net> wrote in message
> news:c655kv$s58$1@reader2.nmix.net...
> > What are the easter eggs in cgi.pm... ? I must ask.
>
> Oh, alright then, Webmaster Robin, come out of your shell and break it to
> us: What are the easter eggs in cgi.pm?
>
well, I was looking through the code, and I thought I could get it to print
some information on how to use it, but then I realized it's probably just
the comments and some docs in there as commnets, I'm still not sure about
this, I'll have to look again, it's near the bottom.
-Robin
------------------------------
Date: Thu, 22 Apr 2004 20:51:33 -0400
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: cgi.pm
Message-Id: <2MydnXB454oO9RXdRVn-vg@adelphia.com>
Robin wrote:
> well, I was looking through the code, and I thought I could get it to
> print some information on how to use it, but then I realized it's probably
> just the comments and some docs in there as commnets
That's more or less what it is. The docs you read with the 'perldoc' tool
(or as man pages, or HTML, or ...) aren't stored separately. They're
embedded in the module itself, in a format called POD - Plain Ol'
Documentation.
See 'perldoc perldoc' for more about the perldoc tool.
See 'perldoc perlpod' for more about the POD format.
sherm--
--
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org
------------------------------
Date: Fri, 23 Apr 2004 00:23:12 +0100
From: mike blamires <mike@mysurname.co.uk>
Subject: Correct use of Unicode in RegExp
Message-Id: <pan.2004.04.22.23.23.05.409768@mysurname.co.uk>
On Thu, 22 Apr 2004 22:36:44 +0100, mike blamires scribbled furiously:
> I am having great difficulty using Unicode characters in a Regular
> Expression, I am trying to match extended Unicode characters.
>
> I am wishing to split a large Dumpfile (containing only JPEGS) I have used
> a hex editor to manually extract a file just to show it can be done, so I
> know the input is intact.
>
> Each JPEG starts with the Unicode characters \u00FF \u00D8 \u00FF \u00E1
> and there are plenty of these to be found within the file.
>
> open(DUMPFILE, "/pathtodumpfile");
> my $line;
> while(<DUMPFILE>) {
> $line = $line.$_;
> }
> @files = split(/\x{00FF}\x{00D8}\x{00FF}\x{00E1}/, $line);
>
> (As you may see from the above style I am relatively inexperienced to the
> perl side of programming ;)
>
> I have tried inserting the Unicode characters in various ways \xFF, \x{FF}
> etc. It just doesn't seem to find the pattern. I am at a bit of a loss as
> to whether it is my regexp that is wrong, my use of Unicode characters
> or use of Extended Unicode characters.
>
> many thanks for your help.
>
> cheers
> Mike
Apologies, incorrect newsgroup first time round. Please see above.
cheers
Mike
------------------------------
Date: Thu, 22 Apr 2004 17:21:36 -0700
From: "Robin" <robin @ infusedlight.net>
Subject: Re: free source guestbook (finished)
Message-Id: <c69p23$j4p$1@reader2.nmix.net>
"Sherm Pendley" <spamtrap@dot-app.org> wrote in message
news:Td2dnXWveIxGhBXdRVn-hw@adelphia.com...
> Robin wrote:
>
> > "Tassilo v. Parseval" <tassilo.parseval@rwth-aachen.de> wrote in message
> > news:c67qpm$8f0fh$1@ID-231055.news.uni-berlin.de...
>
> >> > if ($name !~ /^\s*$/g and $email !~ /^\s*$/g and $message !~
/^\s*$/g
> > and
> >> > $email !~ /<.*>/s and param ('webname') !~ /<.*>/g and param ('url')
!~
> >> > /<.*>/g and $name !~ /<.*>/s and $name !~ /$string/g and $message !~
> >> > /$string/g and $website !~ /$string/g and $email !~ /$string/g and
> >> > $name
> > !~
> >> > /$string2/g and $message !~ /$string2/g and $email !~ /$string2/g and
> > param
> >> > ('webname') !~ /$string2/g and param ('url') !~ /$string2/g)
> >>
> >> Uggh. Maybe it's time to create a function that does the above check
for
> >> you. And again, watch your regex modifiers. What is /g supposed to do
in
> >> the above matches?
>
> > BTW, the /g modifier means global replace.
>
> Please don't parrot the docs back at people who understand them a lot
better
> than you do. It's rude.
>
> The /g modifier specifies global operation when used with s///. But the
> above code isn't doing any substitution; it's just matching with //. So,
> the /g in the above doesn't do anything.
>
> Now, the question remains: What did you *think* it was going to do?
>
> sherm--
your right, I misread my code...sorry everyone...
later,
-Robin
------------------------------
Date: Thu, 22 Apr 2004 17:24:06 -0700
From: "Robin" <robin @ infusedlight.net>
Subject: Re: free source guestbook (finished)
Message-Id: <c69p24$j4p$2@reader2.nmix.net>
"Tassilo v. Parseval" <tassilo.parseval@rwth-aachen.de> wrote in message
news:c69d1j$906pa$1@ID-231055.news.uni-berlin.de...
> Also sprach Robin:
>
> >> You do things at runtime that should be done on installation time. Add
> >> to your README that a header file has to exist. It will simplify your
> >> script if it can be sure that certain files are there.
> >
> >> Same for the footer. What you can do is provide an installation script
> >> in your distribution that will first check the integrity and existance
> >> of all files and, in case they aren't there, create them.
> >
> > your right, the header and footer are packaged with the zip file for the
> > guestbook though, and I implicitly implied that you can edit them, so I
> > guess I should change it to something else. The files don't really have
to
> > exist though. Although I might add code like
>
> [...]
>
> You also mailed this as a CC to me. It would help if you could in future
> mention this in your mail, otherwise I reply via mail just to realize a
> bit later that I should have better responded in the group.
yeah, I had more to say than one message could say, and I didn't realize it
at first.
-Robin
------------------------------
Date: 22 Apr 2004 17:45:06 -0400
From: Uri Guttman <uri.guttman@fmr.com>
Subject: Re: Huffman coding and Parse::RecDescent
Message-Id: <siscoepj4rh9.fsf@tripoli.fmr.com>
>>>>> "JE" == Jon Ericson <Jon.Ericson@jpl.nasa.gov> writes:
JE> events: play(s) /\z/
JE> play: home_run | caught_stealing | hit_by_pitch | catchers_interference
JE> | <error>
JE> home_run: 'H' | 'HR'
JE> caught_stealing: 'CS'
JE> hit_by_pitch: 'HP'
JE> catchers_interference: 'C'
JE> Obviously, there are bugs in the grammar. For instance, it fails when
JE> given 'HP' or 'HR', since the first production in the home_run rule
JE> greedily gobbles up the initial 'H'. It isn't that hard to fix:
two thoughts (i have used P:RD but i am no expert in it). first, you can
use regexes instead of strings and then use anchors/assertions of some
sort:
home_run: /\bH\b/ | /\bHR\b/
also i was under the impression that basic P:RD will split input on
white space so the home_run production should only match H when the
token is H.
all this is conjecture and hopefully the damian will see this and jump
in to correct me. will someone please turn on the damian signal lamp? :)
uri
------------------------------
Date: Thu, 22 Apr 2004 17:00:54 -0700
From: Jon Ericson <Jon.Ericson@jpl.nasa.gov>
Subject: Re: Huffman coding and Parse::RecDescent
Message-Id: <rcgr7ufd0ll.fsf@Jon-Ericson.sdsio.prv>
Uri Guttman <uri.guttman@fmr.com> writes:
> two thoughts (i have used P:RD but i am no expert in it). first, you can
> use regexes instead of strings and then use anchors/assertions of some
> sort:
>
> home_run: /\bH\b/ | /\bHR\b/
>
> also i was under the impression that basic P:RD will split input on
> white space so the home_run production should only match H when the
> token is H.
Right. The problem is this data is *not* split into tokens by white
space. For instance `H8' is the code for an inside the park home run
fielded by the center fielder. Sorry I didn't make that clear.
Someone wrote an email with the suggestion:
home_run: /H(?![A-Z])/ | 'HR'
That does the trick, I think.
I'm not sure Parse::RecDescent is the right tool for the job, but it
sure is fun to play around with. :)
Thanks,
Jon
------------------------------
Date: Fri, 23 Apr 2004 01:12:46 +0200
From: Andries <andries@zilz.nl>
Subject: I know, I know, I don't know
Message-Id: <mpjg80d4v6ol64gmep19f1nh53f0d69l3a@4ax.com>
Hello all,
Yes I'm aware this is the wrong newsgroup (so please point me to the
right one please) I looked in alt how to but only porn there.
So please don't flame
My question is this.
I use whisper (a password generator) for accounts.
Meanwhile i have 1500 accounts so i want to put things in a database
or report to analyse.
Problem is that Whisper doesn't have an export function to ascii text.
I mailed the author of the program and he says it's programmed in
delphi and he hasn't the time to programm this.
I'm not a programmer but i remember from my dos days that you can
print-to-file somehow. I like to think i have a text-file and then i
can arrange things. (I'm trying to learn perl so i have a good
playfield to experiment)
I use Windows 2000 and i can't think of anything to solve my problem.
Andries Meijer
zilz@home.nl
------------------------------
Date: Fri, 23 Apr 2004 00:39:19 +0100
From: mike blamires <mike@mysurname.co.uk>
Subject: Re: I know, I know, I don't know
Message-Id: <pan.2004.04.22.23.39.18.422000@mysurname.co.uk>
On Fri, 23 Apr 2004 01:12:46 +0200, Andries scribbled furiously:
> Hello all,
>
> Yes I'm aware this is the wrong newsgroup (so please point me to the
> right one please) I looked in alt how to but only porn there.
> So please don't flame
I won't flame, just point out alt.os.windows2000 or the large
and often informative newservers supplied by microsoft snews.microsoft.com
which covers a whole multitude of sins :)
<snip>
> Problem is that Whisper doesn't have an export function to ascii text.
> I mailed the author of the program and he says it's programmed in
> delphi and he hasn't the time to programm this.
> I'm not a programmer but i remember from my dos days that you can
> print-to-file somehow. I like to think i have a text-file and then i
> can arrange things. (I'm trying to learn perl so i have a good
> playfield to experiment)
> I use Windows 2000 and i can't think of anything to solve my problem.
If the output is to the dos screen the adding a > c:\yourfile.txt will
save the output to the ASCII file c:\yourfile.txt if you are generating
lots of different executions of the program you will want to replace >
with >> to append.
whisper >> c:\passwordLog.txt
using a relative path rather than the absolute path above will create the
file relative to the working directory.
cheers
Mike "bit rusty on this windows lark" B
------------------------------
Date: Thu, 22 Apr 2004 17:34:33 -0700
From: "Robin" <robin @ infusedlight.net>
Subject: Re: I know, I know, I don't know
Message-Id: <c69pjj$jae$2@reader2.nmix.net>
"Andries" <andries@zilz.nl> wrote in message
news:mpjg80d4v6ol64gmep19f1nh53f0d69l3a@4ax.com...
> Hello all,
>
> Yes I'm aware this is the wrong newsgroup (so please point me to the
> right one please) I looked in alt how to but only porn there.
> So please don't flame
>
> My question is this.
> I use whisper (a password generator) for accounts.
> Meanwhile i have 1500 accounts so i want to put things in a database
> or report to analyse.
> Problem is that Whisper doesn't have an export function to ascii text.
> I mailed the author of the program and he says it's programmed in
> delphi and he hasn't the time to programm this.
> I'm not a programmer but i remember from my dos days that you can
> print-to-file somehow. I like to think i have a text-file and then i
> can arrange things. (I'm trying to learn perl so i have a good
> playfield to experiment)
> I use Windows 2000 and i can't think of anything to solve my problem.
>
> Andries Meijer
> zilz@home.nl
u coulld.....hmmmmm....use perl. check out http://learn.perl.org
or pipe it with > like the above posted said.
-Robin
------------------------------
Date: Thu, 22 Apr 2004 21:39:56 GMT
From: Kman <kengineering@peoplepc.com>
Subject: March your way into the weekend!
Message-Id: <2f2fdd50.e4c63f5f@host-69-48-73-244.roc.choiceone.net>
March your way into the weekend!
Join Nader supporters in DC, April 24-25,
as they rally for justice and equal rights
Washington, DC:
Saturday, April 24th, IMF/World Bank Protest - meet at 11am, 15th & H St, NW.
Sunday, April 25th, March for Women's Lives - meet at 9:30am, Smithsonian Metro Stop.
If you arrive late, ask a volunteer to point you towards the Ralph Nader group.
See you there!
Nader: Oil the Source of Two of Earth’s Major Problems:
Wars for Oil and Climate Change
Protect the Environment and the People of Our Planet by Ending Our Addiction to Oil
Washington, DC: On Earth Day 2004, Independent presidential candidate
Ralph Nader highlighted as two priorities: ending the Iraqi occupation
and facing up to the immediate crisis of global climate change. "Future
geopolitical crises involving oil resources and environmental problems
will be diminished by finding alternatives to fossil fuels," said Nader.
Nader linked the two issues on Earth Day because he sees them as
symptomatic of the corporate oil-based, planet destructive behavior of
the Bush Administration. Nader has called for the United States to
withdraw from Iraq - including military, private military contractors,
oil industry and other corporations. Nader noted: "The war in Iraq is
unleashing widening cycles of violence. The potential for escalation of
violence increases every day the US military remains in Iraq. The way to
reverse the spiral of violence is for the United States to go back home.
The US presence serves as a magnet for the insurrection, kidnapping,
terrorism and destruction." Nader released a three-step strategy for
withdrawal earlier this week. See www.votenader.org for details.
--
For further information, contact:
Kevin Zeese
1-202-265-4000
Matt Ahearn
ahearn@votenader.org
1-201-314-9747
--
is a simple classic stew that makes natural gravy,
thus it does not have to be thickened.
Brown the meat quickly in very hot oil, remove and set aside.
Brown the onions, celery, pepper and garlic.
De-glaze with wine, return meat to the pan and season well.
Stew on low fire adding small amounts of water and
seasoning as necessary.
After at least half an hour, add the carrots and potatoes,
and simmer till root vegetables break with a fork.
Cook a fresh pot of long grained white rice.
Pre-mie Pot Pie
When working with prematurely delivered newborns (or chicken) use sherry;
red wine with beef (buy steak or roast, do not pre-boil).
Pie crust (see index)
Whole fresh pre-mie; eviscerated, head, hands and feet removed
Onions, bell pepper, celery
½ cup wine
Root vegetables of choice (turnips, carrots, potatoes, etc) cubed
Make a crust from scratch - or go shamefully to the frozen food section
of your favorite grocery and select 2 high quality pie crusts (you
will need one for the top also).
Boil the prepared delicacy until the meat starts to come off the bones.
Remove, de-bone and cube; continue to reduce the broth.
Brown the onions, peppers and celery.
Add the meat then season, continue browning.
De-glaze with sherry, add the reduced broth.
Finally, put in the root vegetables and simmer for 15 minutes.
Allow to cool slightly.
Place the pie pan in 375 degree oven for a few minutes so bottom crust is not soggy,
reduce oven to 325.
Fill the pie with stew, place top crust and with a fork, seal th
------------------------------
Date: Fri, 23 Apr 2004 09:09:43 +1000
From: Sisyphus <kalinaubears@iinet.net.au>
Subject: Re: Operator overloading
Message-Id: <408851e3$0$16605$5a62ac22@freenews.iinet.net.au>
Anno Siegel wrote:
>
> Well... I didn't look closely, but you seem to do quite a bit of
> explicit refcount handling. I wonder if it's all necessary.
>
I'll think about that - though there's only a very small penalty with
the current '*=' overload subroutine. On my 1GHz box 50,000 calls to the
overload subroutine adds about 0.06 seconds (in comparison to 50,000
calls to the alternative GMP library function), so I don't think there's
much room for more gain there.
(The overload sub currently contains a 'SvREFCNT_inc()' inside every
'if{}' block. All that's really needed is just the one 'SvREFCNT_inc()'
before the first 'if{}' block. I'll change that in the interests of tidy
coding :-)
Thanks again Anno.
Cheers,
Rob
--
To reply by email u have to take out the u in kalinaubears.
------------------------------
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 6448
***************************************