[27805] in Perl-Users-Digest
Perl-Users Digest, Issue: 9169 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Apr 18 14:06:03 2006
Date: Tue, 18 Apr 2006 11: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 Tue, 18 Apr 2006 Volume: 10 Number: 9169
Today's topics:
ANNOUNCE: DateTime::TimeZone 0.44 (Dave Rolsky)
Re: help: newbie extracting lines from large file. <Super-User@mordor.net>
Re: help: newbie extracting lines from large file. <××DBraughler××@××bwcc·com>
Re: help: newbie extracting lines from large file. <Super-User@mordor.net>
new CPAN modules at Tue Apr 18 2006 (Randal Schwartz)
Re: Other XS progamming questions <bol@adv.magwien.gv.at>
perl start up - persistent interpreters <bugbear@trim_papermule.co.uk_trim>
Re: perl start up - persistent interpreters xhoster@gmail.com
Re: Perl-related events in 2006 ? lars@nospam.nosoftwarepatents.edu
Posting Guidelines for comp.lang.perl.misc ($Revision: tadmc@augustmail.com
problem with my code <fibre_optic@go2.pl>
Re: problem with my code <jurgenex@hotmail.com>
Re: problem with my code <fibre_optic@go2.pl>
Re: problem with my code <fibre_optic@go2.pl>
reading command line options from a file <risto.vaarandi@eyp.ee>
REx bug??? /\x99/ compiles.... <nospam-abuse@ilyaz.org>
Re: REx bug??? /\x99/ compiles.... <rvtol+news@isolution.nl>
Re: REx bug??? /\x99/ compiles.... (Anno Siegel)
Re: XS progamming question <bol@adv.magwien.gv.at>
Re: XS progamming question <nospam-abuse@ilyaz.org>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 17 Apr 2006 19:40:11 GMT
From: autarch@urth.org (Dave Rolsky)
Subject: ANNOUNCE: DateTime::TimeZone 0.44
Message-Id: <Ixx6tF.6FG@zorch.sf-bay.org>
0.44 2006-04-17
- This release is based on version 2006d of the Olson database.
/*===================================================
VegGuide.Org www.BookIRead.com
Your guide to all that's veg. My book blog
===================================================*/
------------------------------
Date: Tue, 18 Apr 2006 00:14:43 -0400
From: Super-User <Super-User@mordor.net>
Subject: Re: help: newbie extracting lines from large file.
Message-Id: <EO2dndh7vr0L-NnZRVn-rg@comcast.com>
First..... Thank you. I will be looking at what you gave first thing in
the morning
> What if there are no entries during the midnight hour, so it goes from
> 11 to 01?
for past seven years... It has never happened.
there is always 00:XX:XX and there are 200+ events on that hour.
if it does happen then there are serious implications for the business
thanks again.
>
> Xho
>
------------------------------
Date: Tue, 18 Apr 2006 00:54:12 -0400
From: Denver <××DBraughler××@××bwcc·com>
Subject: Re: help: newbie extracting lines from large file.
Message-Id: <1248s7mr6jkj2ac@corp.supernews.com>
Super-User wrote:
> Xho wrote:
>> What if there are no entries during the midnight hour, so it goes from
>> 11 to 01?
> for past seven years... It has never happened.
A lot of things happen only once every 14 years.
> there is always 00:XX:XX and there are 200+ events on that hour.
> if it does happen then there are serious implications for the business
Including that software will crash. :(
Xho is right just to look for the hour changing to any lower value.
That gives you a window of more than 22 hours in which unexpected outages won't break your program.
Do it the safe way as Xho suggested. There is no reason to leave it to chance.
------------------------------
Date: Tue, 18 Apr 2006 09:23:03 -0400
From: Super-User <Super-User@mordor.net>
Subject: Re: help: newbie extracting lines from large file.
Message-Id: <XqudnQ6mqty8ddnZnZ2dnUVZ_vWdnZ2d@comcast.com>
YEP. will do. Thanks.
Denver wrote:
> Super-User wrote:
>
>> Xho wrote:
>>
>>> What if there are no entries during the midnight hour, so it goes from
>>> 11 to 01?
>>
>> for past seven years... It has never happened.
>
>
> A lot of things happen only once every 14 years.
>
>
>> there is always 00:XX:XX and there are 200+ events on that hour.
>> if it does happen then there are serious implications for the business
>
>
> Including that software will crash. :(
> Xho is right just to look for the hour changing to any lower value.
> That gives you a window of more than 22 hours in which unexpected
> outages won't break your program.
>
> Do it the safe way as Xho suggested. There is no reason to leave it to
> chance.
------------------------------
Date: Tue, 18 Apr 2006 04:42:05 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules at Tue Apr 18 2006
Message-Id: <IxwIE5.1C62@zorch.sf-bay.org>
The following modules have recently been added to or updated in the
Comprehensive Perl Archive Network (CPAN). You can install them using the
instructions in the 'perlmodinstall' page included with your Perl
distribution.
Asterisk-config-0.7
http://search.cpan.org/~hoowa/Asterisk-config-0.7/
the Asterisk config read and write module.
----
Class-StateMachine-0.12
http://search.cpan.org/~salva/Class-StateMachine-0.12/
define classes for state machines
----
WWW-Salesforce-0.07
http://search.cpan.org/~capoeirab/WWW-Salesforce-0.07/
v0.07 - this class provides a simple abstraction layer between SOAP::Lite and Salesforce.com.
----
Net-Proxy-0.05
http://search.cpan.org/~book/Net-Proxy-0.05/
Framework for proxying network connections in many ways
----
RDF-Sesame-0.14
http://search.cpan.org/~mndrix/RDF-Sesame-0.14/
Interact with Sesame RDF servers
----
Gantry-3.26
http://search.cpan.org/~tkeefer/Gantry-3.26/
Web application framework for mod_perl, cgi, etc.
----
DateTime-TimeZone-0.44
http://search.cpan.org/~drolsky/DateTime-TimeZone-0.44/
Time zone object base class and factory
----
sepia-0.59
http://search.cpan.org/~seano/sepia-0.59/
----
Net-Whois-RIPE-1.23
http://search.cpan.org/~paulg/Net-Whois-RIPE-1.23/
implementation of RIPE Whois.
----
Test-Harness-2.57_04
http://search.cpan.org/~petdance/Test-Harness-2.57_04/
Run Perl standard test scripts with statistics
----
Graph-Easy-As_svg-0.18
http://search.cpan.org/~tels/Graph-Easy-As_svg-0.18/
Output a Graph::Easy as Scalable Vector Graphics (SVG)
----
Danga-Socket-1.50
http://search.cpan.org/~bradfitz/Danga-Socket-1.50/
Event loop and event-driven async socket base class
----
mediawiki-graph-0.19
http://search.cpan.org/~tels/mediawiki-graph-0.19/
----
Graph-Easy-Manual-0.32
http://search.cpan.org/~tels/Graph-Easy-Manual-0.32/
HTML manual for Graph::Easy
----
Graph-Easy-0.44
http://search.cpan.org/~tels/Graph-Easy-0.44/
Render graphs as ASCII, HTML, SVG or Graphviz
----
Finance-QIF-2.03
http://search.cpan.org/~mmcgillis/Finance-QIF-2.03/
Parse and create Quicken Interchange Format files
----
Apache-DB-0.13
http://search.cpan.org/~fwiles/Apache-DB-0.13/
Run the interactive Perl debugger under mod_perl
----
UkrMoney-API-1.01
http://search.cpan.org/~dmitry/UkrMoney-API-1.01/
----
Cache-Memcached-Tie
http://search.cpan.org/~gugu/Cache-Memcached-Tie/
Using Cache::Memcached as hash
----
Sub-Install-0.90
http://search.cpan.org/~rjbs/Sub-Install-0.90/
install subroutines into packages easily
----
DBIx-SQLite-Simple-0.31
http://search.cpan.org/~gomor/DBIx-SQLite-Simple-0.31/
easy access to SQLite databases using objects
----
Algorithm-MedianSelect-XS-0.15
http://search.cpan.org/~schubiger/Algorithm-MedianSelect-XS-0.15/
Median finding algorithm
----
CGI-Wiki-Plugin-SpamMonkey-0.03
http://search.cpan.org/~ivorw/CGI-Wiki-Plugin-SpamMonkey-0.03/
CGI::Wiki plugin for SpamMonkey
----
File-Wildcard-0.08
http://search.cpan.org/~ivorw/File-Wildcard-0.08/
Enhanced glob processing
----
CGI.pm-3.19
http://search.cpan.org/~lds/CGI.pm-3.19/
----
mediawiki-slides-0.02
http://search.cpan.org/~tels/mediawiki-slides-0.02/
----
UkrMoney-API-1.00
http://search.cpan.org/~dmitry/UkrMoney-API-1.00/
----
Audio-TagLib-1.42
http://search.cpan.org/~dongxu/Audio-TagLib-1.42/
a library for reading and editing audio meta data, commonly known as *tags*.
----
Test-WWW-Mechanize-Catalyst-0.36
http://search.cpan.org/~lbrocard/Test-WWW-Mechanize-Catalyst-0.36/
Test::WWW::Mechanize for Catalyst
----
Test-WWW-Selenium-0.20
http://search.cpan.org/~lukec/Test-WWW-Selenium-0.20/
Test applications using Selenium Remote Control
----
Apache2-JemplateFilter-0.01
http://search.cpan.org/~fujiwara/Apache2-JemplateFilter-0.01/
Jemplate complie filter for Apache2
----
XML-RSS-LibXML-0.19
http://search.cpan.org/~dmaki/XML-RSS-LibXML-0.19/
XML::RSS with XML::LibXML
----
Xango-1.06
http://search.cpan.org/~dmaki/Xango-1.06/
Event Based High Performance Web Crawler Framework
----
Perl-Critic-0.15_01
http://search.cpan.org/~thaljef/Perl-Critic-0.15_01/
Critique Perl source code for best-practices
----
Moose-0.04
http://search.cpan.org/~stevan/Moose-0.04/
Moose, it's the new Camel
If you're an author of one of these modules, please submit a detailed
announcement to comp.lang.perl.announce, and we'll pass it along.
print "Just another Perl hacker," # the original
--
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: Tue, 18 Apr 2006 12:05:32 +0200
From: "Ferry Bolhar" <bol@adv.magwien.gv.at>
Subject: Re: Other XS progamming questions
Message-Id: <1145354733.539938@proxy.dienste.wien.at>
Anno Siegel:
> > SV *sv1 = newSViv(7);
> > SV *sv2 = newSVrv(sv1,"myclass");
> >
> > sv1 is a reference to the object in sv2, right?
>
> No, the other way around. The object proper is the (integer) scalar
> sv1. sv2 is a reference to sv1, which has been blessed into "myclass".
Hm... have a look at this XS code:
CODE:
SV *sv1,*sv2;
sv1 = newSViv(7);
fprintf(stderr,"SV1 before SVrv:\n");
sv_dump(sv1);
sv2 = newSVrv(sv1,"myClass");
fprintf(stderr,"SV1 after SVrv:\n");
sv_dump(sv1);
fprintf(stderr,"SV2:\n");
which yields:
SV1 before SVrv:
SV = IV(0x99b633c) at 0x992cc20
REFCNT = 1
FLAGS = (IOK,pIOK)
IV = 7
SV1 after SVrv:
SV = PVIV(0x992d308) at 0x992cc20
REFCNT = 1
FLAGS = (ROK)
IV = 7
RV = 0x992cd10
PV = 0x992cd10 ""
CUR = 0
LEN = 0
SV2:
SV = PVMG(0x995b360) at 0x992cd10
REFCNT = 1
FLAGS = (OBJECT)
IV = 0
NV = 0
PV = 0
STASH = 0x9940120 "myClass"
So, as you can see, SV1 is the reference and SV2 is the blessed
object! SV1 was upgraded from an IV to a PVIV, but is now used
as RV only (ROK flag is set, IOK/pIOK flags are cleared). And
SV2 is a new PVMG wherein the "STASH" slot is used only, the
MAGIC slot is unused. So SV2 becomes the "blessed object".
> > And sv2 is just a magical SV with its "stash" pointing to pv "class".
> No, sv2 itself is just a reference.
No, sv2 is the object.
> sv1 is also not strictly magical
> (I don't think so), but has type 7 (SVt_PVMG) and the SvSTASH() function
> will return the stash it is blessed into.
That's true for sv2.
> > But what I can't understand is the actual purpose of sv1. Why I need
> > the reference for blessing? Or in other words, why do I need the
> > reference when upgrading a SV to SVMG?
>
> The question is based on wrong assumptions.
>
> > Similar in Perl:
> >
> > $myobj = bless (\$sv1, "class");
> >
> > OK, $myobj is now an object blessed into "class". So writing
>
> That's shorthand. $myobj is a reference to an object. The object proper
> is $sv1. It carries the blessing, not the reference.
Yes, for Perls "bless", that's true, but for the newSVrv function, it's not
so.
> Since objects in
> Perl are exclusively accessed through references,
And that's the point: why this is so?
> it is common to speak
> of $myobj as "the object", but that is a slight misrepresentation.
No, for "bless", it's true:
use Devel::Peek;
$sv1 = 'a';
$sv2 = bless(\$sv1,"class");
Dump $sv2;
Dump $sv1;
SV = RV(0x8bff9f0) at 0x8bf2600
REFCNT = 1
FLAGS = (ROK)
RV = 0x8bee150
SV = PVMG(0x8c09400) at 0x8bee150
REFCNT = 2
FLAGS = (OBJECT,POK,pPOK)
IV = 0
NV = 0
PV = 0x8bead58 "a"\0
CUR = 1
LEN = 2
STASH = 0x8bdade8 "class"
SV = PVMG(0x8c09400) at 0x8bee150
REFCNT = 2
FLAGS = (OBJECT,POK,pPOK)
IV = 0
NV = 0
PV = 0x8bead58 "a"\0
CUR = 1
LEN = 2
STASH = 0x8bdade8 "class"
So, here $sv2 is actual a RV pointing to $sv1, the blessed PVMG.
This is similar to the XS code
sv2 = sv_setref_pv(sv1,"myClass","a");
But with newSVrv, it's quite different.
> > $myobj->test(1);
> >
> > is just another form for
> >
> > class::test($myobj,1);
>
> No, you're forgetting about inheritance. "class::test" is one and only
> one sub, but "$myobj->test(1)" may call a method test in any class "class"
> inherits from.
Yes, you're right, of course. I though more on the syntactical aspects.
> > But what's the purpose of $sv1 here? It is never used again.
>
> That's because Perl supports object access only through references. It is
> quite customary to make the underlying object an anonymous data structure,
> so that $sv1 as a named variable doesn't exist (or, in the scalar case,
> doesn't survive object creation). Its name is, in fact, nowhere needed,
> but its existence as an SV is essential.
But I cant't understand why I _must_ use a RV to access SV used as
object. It's OK that I _can_ do so, but why the need? Just syntactical
reasons? Or are there implementation needs as well?
> > To the XS example above, I can made a sv_dump(sv2) to see the
> > magical SV. Can I access directly this SV from Perl as well? Or do I
have
> > always to use a reference? I can't see the concept in this
implementation.
>
> It looks like you are again confusing the roles of sv1 and sv2.
No, please look at my example above.
>> 2) The docs (perlguts) say "If you mortalize a variable twice, the
reference
>> count will later be decremented twice". Is this correct?
> The temp bit is rather secondary. The main thing is, the SV is entered
> to the list of mortals.
Ah - this explains all. Is there a PL_xxxxx location to access this list?
Many thanks for yout help,
Ferry
--
Ing. Ferry Bolhar
Municipality of Vienna, Department 14
A-1010 Vienna / AUSTRIA
E-mail: bol@adv.magwien.gv.at
------------------------------
Date: Tue, 18 Apr 2006 16:34:21 +0100
From: bugbear <bugbear@trim_papermule.co.uk_trim>
Subject: perl start up - persistent interpreters
Message-Id: <44450709$0$2539$ed2619ec@ptn-nntp-reader02.plus.net>
I note that mod_perl
http://perl.apache.org/
is an embedded perl interpreter inside
Apache, pretty much optimised
for doing CGI type stuff fast.
I have an application where I would
very much like this benefit of reduced
perl startup time, but don't want Apache;
my application does does not involve
outputting HTML.
Are there any (other) persistent perl
interpreters out there?
BugBear
------------------------------
Date: 18 Apr 2006 16:20:20 GMT
From: xhoster@gmail.com
Subject: Re: perl start up - persistent interpreters
Message-Id: <20060418123325.234$o9@newsreader.com>
bugbear <bugbear@trim_papermule.co.uk_trim> wrote:
> I note that mod_perl
> http://perl.apache.org/
> is an embedded perl interpreter inside
> Apache, pretty much optimised
> for doing CGI type stuff fast.
I could be wrong, but I think the fact that it doesn't need to start
up each time is pretty much the only speed optimization that was done, no?
> I have an application where I would
> very much like this benefit of reduced
> perl startup time, but don't want Apache;
> my application does does not involve
> outputting HTML.
>
> Are there any (other) persistent perl
> interpreters out there?
The plain old perl is already persistent. It doesn't exit until you
(directly or indirectly, by letting exceptions fall through) tell it to.
So, just don't exit and you won't have to restart it.
Presumably, you have some specific requirements for getting requests into
or out of this persistent executable, but without knowing what they are
it would be hard to provide specific recommendations.
Xho
--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
------------------------------
Date: Tue, 18 Apr 2006 12:06:51 GMT
From: lars@nospam.nosoftwarepatents.edu
Subject: Re: Perl-related events in 2006 ?
Message-Id: <vD41g.1083$hi2.641@news.itd.umich.edu>
brian d foy <brian.d.foy@gmail.com> wrote:
: Here's some of the stuff from the calendar of the latest issue of The
: Perl Review, along with some stuff that came out after we went to
: press.
Thanks. I'll look for the Perl Mongers events, too.
--
Lars
Software patents harm all Net-based business, write your MEP:
http://wwwdb.europarl.eu.int/ep6/owa/p_meps2.repartition?ilg=EN
------------------------------
Date: 18 Apr 2006 07:25:32 GMT
From: tadmc@augustmail.com
Subject: Posting Guidelines for comp.lang.perl.misc ($Revision: 1.5 $)
Message-Id: <4444946b$0$61164$ae4e5890@news.nationwide.net>
Outline
Before posting to comp.lang.perl.misc
Must
- Check the Perl Frequently Asked Questions (FAQ)
- Check the other standard Perl docs (*.pod)
Really Really Should
- Lurk for a while before posting
- Search a Usenet archive
If You Like
- Check Other Resources
Posting to comp.lang.perl.misc
Is there a better place to ask your question?
- Question should be about Perl, not about the application area
How to participate (post) in the clpmisc community
- Carefully choose the contents of your Subject header
- Use an effective followup style
- Speak Perl rather than English, when possible
- Ask perl to help you
- Do not re-type Perl code
- Provide enough information
- Do not provide too much information
- Do not post binaries, HTML, or MIME
Social faux pas to avoid
- Asking a Frequently Asked Question
- Asking a question easily answered by a cursory doc search
- Asking for emailed answers
- Beware of saying "doesn't work"
- Sending a "stealth" Cc copy
Be extra cautious when you get upset
- Count to ten before composing a followup when you are upset
- Count to ten after composing and before posting when you are upset
-----------------------------------------------------------------
Posting Guidelines for comp.lang.perl.misc ($Revision: 1.5 $)
This newsgroup, commonly called clpmisc, is a technical newsgroup
intended to be used for discussion of Perl related issues (except job
postings), whether it be comments or questions.
As you would expect, clpmisc discussions are usually very technical in
nature and there are conventions for conduct in technical newsgroups
going somewhat beyond those in non-technical newsgroups.
The article at:
http://www.catb.org/~esr/faqs/smart-questions.html
describes how to get answers from technical people in general.
This article describes things that you should, and should not, do to
increase your chances of getting an answer to your Perl question. It is
available in POD, HTML and plain text formats at:
http://mail.augustmail.com/~tadmc/clpmisc.shtml
For more information about netiquette in general, see the "Netiquette
Guidelines" at:
http://andrew2.andrew.cmu.edu/rfc/rfc1855.html
A note to newsgroup "regulars":
Do not use these guidelines as a "license to flame" or other
meanness. It is possible that a poster is unaware of things
discussed here. Give them the benefit of the doubt, and just
help them learn how to post, rather than assume
A note about technical terms used here:
In this document, we use words like "must" and "should" as
they're used in technical conversation (such as you will
encounter in this newsgroup). When we say that you *must* do
something, we mean that if you don't do that something, then
it's unlikely that you will benefit much from this group.
We're not bossing you around; we're making the point without
lots of words.
Do *NOT* send email to the maintainer of these guidelines. It will be
discarded unread. The guidelines belong to the newsgroup so all
discussion should appear in the newsgroup. I am just the secretary that
writes down the consensus of the group.
Before posting to comp.lang.perl.misc
Must
This section describes things that you *must* do before posting to
clpmisc, in order to maximize your chances of getting meaningful replies
to your inquiry and to avoid getting flamed for being lazy and trying to
have others do your work.
The perl distribution includes documentation that is copied to your hard
drive when you install perl. Also installed is a program for looking
things up in that (and other) documentation named 'perldoc'.
You should either find out where the docs got installed on your system,
or use perldoc to find them for you. Type "perldoc perldoc" to learn how
to use perldoc itself. Type "perldoc perl" to start reading Perl's
standard documentation.
Check the Perl Frequently Asked Questions (FAQ)
Checking the FAQ before posting is required in Big 8 newsgroups in
general, there is nothing clpmisc-specific about this requirement.
You are expected to do this in nearly all newsgroups.
You can use the "-q" switch with perldoc to do a word search of the
questions in the Perl FAQs.
Check the other standard Perl docs (*.pod)
The perl distribution comes with much more documentation than is
available for most other newsgroups, so in clpmisc you should also
see if you can find an answer in the other (non-FAQ) standard docs
before posting.
It is *not* required, or even expected, that you actually *read* all of
Perl's standard docs, only that you spend a few minutes searching them
before posting.
Try doing a word-search in the standard docs for some words/phrases
taken from your problem statement or from your very carefully worded
"Subject:" header.
Really Really Should
This section describes things that you *really should* do before posting
to clpmisc.
Lurk for a while before posting
This is very important and expected in all newsgroups. Lurking means
to monitor a newsgroup for a period to become familiar with local
customs. Each newsgroup has specific customs and rituals. Knowing
these before you participate will help avoid embarrassing social
situations. Consider yourself to be a foreigner at first!
Search a Usenet archive
There are tens of thousands of Perl programmers. It is very likely
that your question has already been asked (and answered). See if you
can find where it has already been answered.
One such searchable archive is:
http://groups.google.com/advanced_group_search
If You Like
This section describes things that you *can* do before posting to
clpmisc.
Check Other Resources
You may want to check in books or on web sites to see if you can
find the answer to your question.
But you need to consider the source of such information: there are a
lot of very poor Perl books and web sites, and several good ones
too, of course.
Posting to comp.lang.perl.misc
There can be 200 messages in clpmisc in a single day. Nobody is going to
read every article. They must decide somehow which articles they are
going to read, and which they will skip.
Your post is in competition with 199 other posts. You need to "win"
before a person who can help you will even read your question.
These sections describe how you can help keep your article from being
one of the "skipped" ones.
Is there a better place to ask your question?
Question should be about Perl, not about the application area
It can be difficult to separate out where your problem really is,
but you should make a conscious effort to post to the most
applicable newsgroup. That is, after all, where you are the most
likely to find the people who know how to answer your question.
Being able to "partition" a problem is an essential skill for
effectively troubleshooting programming problems. If you don't get
that right, you end up looking for answers in the wrong places.
It should be understood that you may not know that the root of your
problem is not Perl-related (the two most frequent ones are CGI and
Operating System related), so off-topic postings will happen from
time to time. Be gracious when someone helps you find a better place
to ask your question by pointing you to a more applicable newsgroup.
How to participate (post) in the clpmisc community
Carefully choose the contents of your Subject header
You have 40 precious characters of Subject to win out and be one of
the posts that gets read. Don't waste them. Take care while
composing them, they are the key that opens the door to getting an
answer.
Spend them indicating what aspect of Perl others will find if they
should decide to read your article.
Do not spend them indicating "experience level" (guru, newbie...).
Do not spend them pleading (please read, urgent, help!...).
Do not spend them on non-Subjects (Perl question, one-word
Subject...)
For more information on choosing a Subject see "Choosing Good
Subject Lines":
http://www.cpan.org/authors/id/D/DM/DMR/subjects.post
Part of the beauty of newsgroup dynamics, is that you can contribute
to the community with your very first post! If your choice of
Subject leads a fellow Perler to find the thread you are starting,
then even asking a question helps us all.
Use an effective followup style
When composing a followup, quote only enough text to establish the
context for the comments that you will add. Always indicate who
wrote the quoted material. Never quote an entire article. Never
quote a .signature (unless that is what you are commenting on).
Intersperse your comments *following* each section of quoted text to
which they relate. Unappreciated followup styles are referred to as
"top-posting", "Jeopardy" (because the answer comes before the
question), or "TOFU" (Text Over, Fullquote Under).
Reversing the chronology of the dialog makes it much harder to
understand (some folks won't even read it if written in that style).
For more information on quoting style, see:
http://web.presby.edu/~nnqadmin/nnq/nquote.html
Speak Perl rather than English, when possible
Perl is much more precise than natural language. Saying it in Perl
instead will avoid misunderstanding your question or problem.
Do not say: I have variable with "foo\tbar" in it.
Instead say: I have $var = "foo\tbar", or I have $var = 'foo\tbar',
or I have $var = <DATA> (and show the data line).
Ask perl to help you
You can ask perl itself to help you find common programming mistakes
by doing two things: enable warnings (perldoc warnings) and enable
"strict"ures (perldoc strict).
You should not bother the hundreds/thousands of readers of the
newsgroup without first seeing if a machine can help you find your
problem. It is demeaning to be asked to do the work of a machine. It
will annoy the readers of your article.
You can look up any of the messages that perl might issue to find
out what the message means and how to resolve the potential mistake
(perldoc perldiag). If you would like perl to look them up for you,
you can put "use diagnostics;" near the top of your program.
Do not re-type Perl code
Use copy/paste or your editor's "import" function rather than
attempting to type in your code. If you make a typo you will get
followups about your typos instead of about the question you are
trying to get answered.
Provide enough information
If you do the things in this item, you will have an Extremely Good
chance of getting people to try and help you with your problem!
These features are a really big bonus toward your question winning
out over all of the other posts that you are competing with.
First make a short (less than 20-30 lines) and *complete* program
that illustrates the problem you are having. People should be able
to run your program by copy/pasting the code from your article. (You
will find that doing this step very often reveals your problem
directly. Leading to an answer much more quickly and reliably than
posting to Usenet.)
Describe *precisely* the input to your program. Also provide example
input data for your program. If you need to show file input, use the
__DATA__ token (perldata.pod) to provide the file contents inside of
your Perl program.
Show the output (including the verbatim text of any messages) of
your program.
Describe how you want the output to be different from what you are
getting.
If you have no idea at all of how to code up your situation, be sure
to at least describe the 2 things that you *do* know: input and
desired output.
Do not provide too much information
Do not just post your entire program for debugging. Most especially
do not post someone *else's* entire program.
Do not post binaries, HTML, or MIME
clpmisc is a text only newsgroup. If you have images or binaries
that explain your question, put them in a publically accessible
place (like a Web server) and provide a pointer to that location. If
you include code, cut and paste it directly in the message body.
Don't attach anything to the message. Don't post vcards or HTML.
Many people (and even some Usenet servers) will automatically filter
out such messages. Many people will not be able to easily read your
post. Plain text is something everyone can read.
Social faux pas to avoid
The first two below are symptoms of lots of FAQ asking here in clpmisc.
It happens so often that folks will assume that it is happening yet
again. If you have looked but not found, or found but didn't understand
the docs, say so in your article.
Asking a Frequently Asked Question
It should be understood that you may have missed the applicable FAQ
when you checked, which is not a big deal. But if the Frequently
Asked Question is worded similar to your question, folks will assume
that you did not look at all. Don't become indignant at pointers to
the FAQ, particularly if it solves your problem.
Asking a question easily answered by a cursory doc search
If folks think you have not even tried the obvious step of reading
the docs applicable to your problem, they are likely to become
annoyed.
If you are flamed for not checking when you *did* check, then just
shrug it off (and take the answer that you got).
Asking for emailed answers
Emailed answers benefit one person. Posted answers benefit the
entire community. If folks can take the time to answer your
question, then you can take the time to go get the answer in the
same place where you asked the question.
It is OK to ask for a *copy* of the answer to be emailed, but many
will ignore such requests anyway. If you munge your address, you
should never expect (or ask) to get email in response to a Usenet
post.
Ask the question here, get the answer here (maybe).
Beware of saying "doesn't work"
This is a "red flag" phrase. If you find yourself writing that,
pause and see if you can't describe what is not working without
saying "doesn't work". That is, describe how it is not what you
want.
Sending a "stealth" Cc copy
A "stealth Cc" is when you both email and post a reply without
indicating *in the body* that you are doing so.
Be extra cautious when you get upset
Count to ten before composing a followup when you are upset
This is recommended in all Usenet newsgroups. Here in clpmisc, most
flaming sub-threads are not about any feature of Perl at all! They
are most often for what was seen as a breach of netiquette. If you
have lurked for a bit, then you will know what is expected and won't
make such posts in the first place.
But if you get upset, wait a while before writing your followup. I
recommend waiting at least 30 minutes.
Count to ten after composing and before posting when you are upset
After you have written your followup, wait *another* 30 minutes
before committing yourself by posting it. You cannot take it back
once it has been said.
AUTHOR
Tad McClellan <tadmc@augustmail.com> and many others on the
comp.lang.perl.misc newsgroup.
------------------------------
Date: Tue, 18 Apr 2006 11:06:56 +0200
From: Fibre Optic <fibre_optic@go2.pl>
Subject: problem with my code
Message-Id: <e22a5t$85s$1@inews.gazeta.pl>
Hi,
i a newbe in Perl so i have the following problem. I have written the
following code:
use strict;
while ( <STDIN> ) {
my $line = $_;
chomp( $line );
if( $line =~ /^T/ )
{
printf("%s\n", $line);
}
}
i execute the code in the following way: xxx.pl < rrrr.txt
I am expecting that perl will printout all lines from rrrr.txt which
begins with 'T'. Unfortunately it does not display anything. Could
anyone of you put some light on this simple problem ?
Thank you !
FO
------------------------------
Date: Tue, 18 Apr 2006 09:26:37 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: problem with my code
Message-Id: <hh21g.4232$V73.1048@trnddc06>
Fibre Optic wrote:
> i a newbe in Perl so i have the following problem. I have written the
> following code:
[code snipped]
There doesn't seem to be anything wrong with your code, at least nothing
obvious.
> i execute the code in the following way: xxx.pl < rrrr.txt
>
> I am expecting that perl will printout all lines from rrrr.txt which
> begins with 'T'. Unfortunately it does not display anything.
Good problem description! Unfortunately it is very rare that people include
both, what they expect to happen versus what actually happens.
Are you running on Windows by chance? Could you try calling your program as
perl xxx.pl < rrrr.txt
I remember having this problem once and it seems to be an issue with how
Windows passes parameters. Unfortunately I forgot how I fixed it. But at
least this may give you a workaround until you find the actual solution.
jue
------------------------------
Date: Tue, 18 Apr 2006 11:46:06 +0200
From: Fibre Optic <fibre_optic@go2.pl>
To: =?ISO-8859-2?Q?J=FCrgen_Exner?= <jurgenex@hotmail.com>
Subject: Re: problem with my code
Message-Id: <4444B55E.3040901@go2.pl>
Jürgen Exner wrote:
> Fibre Optic wrote:
>> i a newbe in Perl so i have the following problem. I have written the
>> following code:
> [code snipped]
>
> There doesn't seem to be anything wrong with your code, at least nothing
> obvious.
>
>> i execute the code in the following way: xxx.pl < rrrr.txt
>>
>> I am expecting that perl will printout all lines from rrrr.txt which
>> begins with 'T'. Unfortunately it does not display anything.
>
> Good problem description! Unfortunately it is very rare that people include
> both, what they expect to happen versus what actually happens.
>
> Are you running on Windows by chance? Could you try calling your program as
>
> perl xxx.pl < rrrr.txt
>
> I remember having this problem once and it seems to be an issue with how
> Windows passes parameters. Unfortunately I forgot how I fixed it. But at
> least this may give you a workaround until you find the actual solution.
>
> jue
>
>
You have right ! I have just checked the code on linux and it works
without problem! For some reason it does not work on winXP. I tried to
execute the cod on the following way:
perl xxx.pl < rrrr.txt
and it works on Windows too.
Thank you all !
Regards,
FO
------------------------------
Date: Tue, 18 Apr 2006 11:47:59 +0200
From: Fibre Optic <fibre_optic@go2.pl>
To: =?ISO-8859-2?Q?J=FCrgen_Exner?= <jurgenex@hotmail.com>
Subject: Re: problem with my code
Message-Id: <4444B5CF.8060903@go2.pl>
Jürgen Exner wrote:
> Fibre Optic wrote:
>> i a newbe in Perl so i have the following problem. I have written the
>> following code:
> [code snipped]
>
> There doesn't seem to be anything wrong with your code, at least nothing
> obvious.
>
>> i execute the code in the following way: xxx.pl < rrrr.txt
>>
>> I am expecting that perl will printout all lines from rrrr.txt which
>> begins with 'T'. Unfortunately it does not display anything.
>
> Good problem description! Unfortunately it is very rare that people include
> both, what they expect to happen versus what actually happens.
>
> Are you running on Windows by chance? Could you try calling your program as
>
> perl xxx.pl < rrrr.txt
>
> I remember having this problem once and it seems to be an issue with how
> Windows passes parameters. Unfortunately I forgot how I fixed it. But at
> least this may give you a workaround until you find the actual solution.
>
> jue
>
>
You have right ! I have just checked the code on linux and it works
without problem! For some reason it does not work on winXP. I tried to
execute the cod on the following way:
perl xxx.pl < rrrr.txt
and it works on Windows too.
Thank you all !
Regards,
FO
------------------------------
Date: Tue, 18 Apr 2006 14:11:52 +0300
From: Risto Vaarandi <risto.vaarandi@eyp.ee>
Subject: reading command line options from a file
Message-Id: <4444c978$1@worldnews.eypsise>
hi all,
what is the best strategy for reading command line options from a file?
So far, I have used Getopt::Long for processing command line options,
but with some tools I've written command lines tend to get rather long.
I have been thinking of storing some options in a file - when a Perl
script starts, it reads the options from the file and pushes them to
@ARGV, and after that Getopt::Long::GetOptions() is called for the
modified @ARGV list. Is this the optimal way for solving the problem, or
are there better workarounds?
br,
risto
------------------------------
Date: Tue, 18 Apr 2006 08:54:58 +0000 (UTC)
From: Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: REx bug??? /\x99/ compiles....
Message-Id: <e229h2$2mqi$1@agate.berkeley.edu>
One can easily check that /\99/ is equivalent to /\000(?:99)/. A
warning is emitted, but the interpretation is, IMO, OBVIOUSLY not one
intended by the user.
So the question is: is there any justification for it warning instead
of failing? And: is not it DESIRABLE to change this to a fatal error?
Thanks,
Ilya
P.S. Note that the failure mode is very different from /\gg/, which
is guessed to mean /gg/...
------------------------------
Date: Tue, 18 Apr 2006 12:42:20 +0200
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: REx bug??? /\x99/ compiles....
Message-Id: <e22mum.1gk.1@news.isolution.nl>
Ilya Zakharevich schreef:
> One can easily check that /\99/ is equivalent to /\000(?:99)/.
Nice catch. It's a pity that Deparse doesn't show it:
$ perl -MO=Deparse,x=7 -Mwarnings -e '/\89/'
Illegal octal digit '8' ignored at -e line 1.
Illegal octal digit '8' ignored at -e line 1.
use warnings;
/\89/;
-e syntax OK
With plenty of capture groups, \99 gets a different meaning:
$ perl -le '$r="(.)"x100; $_=")"x102; s/$r\99/:/; print'
:)
--
Affijn, Ruud
"Gewoon is een tijger."
------------------------------
Date: 18 Apr 2006 11:01:01 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: REx bug??? /\x99/ compiles....
Message-Id: <4ajv7dFtbsccU1@news.dfncis.de>
Ilya Zakharevich <nospam-abuse@ilyaz.org> wrote in comp.lang.perl.misc:
>
> One can easily check that /\99/ is equivalent to /\000(?:99)/. A
> warning is emitted, but the interpretation is, IMO, OBVIOUSLY not one
> intended by the user.
The warning "Illegal octal digit '9' ignored at..." is also incorrect.
The digit "9" is *not* ignored but taken as an indication that the
sequence of octal digits ends here and "9" is just another character
to match.
Another question is why the warning appears twice. The second "9"
is not the reason (it is just text), as can be seen from
perl -wle '"\00789" =~ /\789/ and print "match"'
Illegal octal digit '8' ignored at -e line 1.
Illegal octal digit '8' ignored at -e line 1.
match
That's pretty messy.
> So the question is: is there any justification for it warning instead
> of failing? And: is not it DESIRABLE to change this to a fatal error?
Apart from the standard objection that it may break old code it don't
see a reason why it shouldn't fail.
Anno
--
If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers.
------------------------------
Date: Tue, 18 Apr 2006 10:31:22 +0200
From: "Ferry Bolhar" <bol@adv.magwien.gv.at>
Subject: Re: XS progamming question
Message-Id: <1145349083.890536@proxy.dienste.wien.at>
Ilya Zakharevich:
> As I explained later in the message, IIRC, it HAS a runtime effect.
>
> > But where? Which OP is used for "package"?
>
> I think one which does "cleanup" in the beginning of every statement.
Ah - you're talking about COPs (shown as 'nextstate' OP in various
output) and its "HV* cop_stash" slot, do you? In other words, the
package within an OP gets executed, is stored in its preceeding COP?
Or, in other words, all "cop_stash" slots within a package point to the
same HV?
MTIA & kind greetings,
Ferry
--
Ing. Ferry Bolhar
Municipality of Vienna, Department 14
A-1010 Vienna / AUSTRIA
E-mail: bol@adv.magwien.gv.at
------------------------------
Date: Tue, 18 Apr 2006 09:24:52 +0000 (UTC)
From: Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: XS progamming question
Message-Id: <e22b94$2nar$1@agate.berkeley.edu>
[A complimentary Cc of this posting was sent to
Ferry Bolhar
<bol@adv.magwien.gv.at>], who wrote in article <1145349083.890536@proxy.dienste.wien.at>:
> > > But where? Which OP is used for "package"?
> > I think one which does "cleanup" in the beginning of every statement.
> Ah - you're talking about COPs (shown as 'nextstate' OP in various
> output) and its "HV* cop_stash" slot, do you? In other words, the
> package within an OP gets executed, is stored in its preceeding COP?
> Or, in other words, all "cop_stash" slots within a package point to the
> same HV?
... Hard to parse this...
Let me try to restate this in "plain" language: the notion of "current
package" is crucial during compile time. At run time it is not very
important - with a few exceptions. To support these exceptions, and
to not slow down execution (take into account all these next/last, and
do not forget goto, they all can easily cross boundaries of packages),
at compile time the "current package" is stored inside the "cleanup"
OP, `nextstate'. (cop_stash - think of it as
cleanup_op_symbol_table_hash).
Is it more clear now?
Yours,
Ilya
------------------------------
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 9169
***************************************