[28649] in Perl-Users-Digest
Perl-Users Digest, Issue: 10013 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Nov 28 11:05:58 2006
Date: Tue, 28 Nov 2006 08:05:06 -0800 (PST)
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, 28 Nov 2006 Volume: 10 Number: 10013
Today's topics:
Re: Expression problem <MisterPerl@gmail.com>
Re: Help improving IO::Socket script response <dragnet\_@_/internalysis.com>
Re: How to get the DOM from a XML page <nobull67@gmail.com>
MI5 Persecution: bugging and counter-surveillance MI5-Victim@mi5.gov.uk
MI5 Persecution: cost of the operation MI5-Victim@mi5.gov.uk
MI5 Persecution: how and why did it start? MI5-Victim@mi5.gov.uk
MI5 Persecution: the BBC, television and radio MI5-Victim@mi5.gov.uk
Re: Multi Line Match and Regex <bradbrockman@yahoo.com>
Posting Guidelines for comp.lang.perl.misc ($Revision: tadmc@augustmail.com
PS: Expression problem <MisterPerl@gmail.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 28 Nov 2006 07:37:05 -0800
From: "Mr P" <MisterPerl@gmail.com>
Subject: Re: Expression problem
Message-Id: <1164728225.329203.127460@45g2000cws.googlegroups.com>
K.J. 44 wrote:
> Thank you very much for your help and suggestions. I will try these
> out.
>
> Thanks!
> xhoster@gmail.com wrote:
> > "K.J. 44" <Holleran.Kevin@gmail.com> wrote:
> > > I have the two following regular expressions. I am not very good at
> > > writing these yet. I am parsing some logs looking for some key words,
> > > then taking the text after them.
> > >
> > > if ($details[$i] =~ /\bworkstation\b\bname:\b\s\b[0-9A-Za-z_\-]+\b/i) {
> >
.
.
.
I'm not sure what lead up to $details[$i] , but you ain't in VB land
anymore.. Perl has a much cleaner syntax of which you can take
advantage, such as:
for ( @ details )
{
next unless /\bworkstation\b\bname:\b\s\b([0-9A-Za-z_\-])+\b/; #
this is your regex
.
.
# at this point you can "do stuff" with $1 or whatever...
}
Avoid INDEXED arrays- you seldom need to carry that motley syntax into
The Land of Perl; enjoy the beautiful landscape that IS Perl!
PS: [0-9A-Za-z_\-] looks a LOT like \w
------------------------------
Date: Tue, 28 Nov 2006 02:27:35 -0600
From: Marc Bissonnette <dragnet\_@_/internalysis.com>
Subject: Re: Help improving IO::Socket script response
Message-Id: <Xns9889232446531dragnetinternalysisc@216.196.97.131>
"J. Gleixner" <glex_no-spam@qwest-spam-no.invalid> altered the spacetime
fabric by disgorging news:456b756a$0$503$815e3792@news.qwest.net:
> Marc Bissonnette wrote:
>> Hi all;
>>
>> I'm not sure where/what I've gone wrong here; The purpose of the code
>> below is to get the server type (Apache/IIS/etc) from a list of URLs.
>> In the SQL query (whose results are used in the IO::Socket call), the
>> data from 'cname' will be a string, like "Foo Internet", the data
>> from 'mainurl' will be a url like "www.foo.com"
>>
>> The problem lies in massive time-outs (I don't know what the longest
>> is/can be: I've killed the process after ten minutes, however); The
>> only sanity-saving option so far is to run it in batches of ten URLs,
>> but I've got a list of ~400 to go through.
>>
>> I've googled for somehow using a timeout with IO::Socket, but all the
>> responses seem to be that timeout is deprecated and only applies to
>> the handshake, not the listen/read. I'd be *really* happy if I could
>> simply get this to work with giving each url 5 seconds to respond
>> with the first 8 lines to get the Server: header.
>>
>> I've trimmed my code to get rid of all the HTML output for
>> legibility's sake; The reason for this little script is merely
>> curiosity; A thread in can.internet.highspeed was asking what OS the
>> majority of ISPs in Canada are running, so I thought I'd take a crack
>> at it.
>>
>> Many thanks for any provided insights or suggested reading! (I've
>> gone over the CPAN entries for IO::Socket and IO::Socket::INET
>> several times, but don't seem to be absorbing what it is that's
>> causeing the timeouts)
>>
>> #!/usr/bin/perl
>> use CGI;
>> use IO::Socket;
>> use URI::Escape;
>> use CGI::Carp qw(fatalsToBrowser);
>> use DBI;
>> use strict;
>>
>> my $row;
>> my $keys;
>> my $key;
>> my $sock;
>> my %hosts;
>> my $hosts;
>> my $host;
>> my $dbname;
>> my $dbuser;
>> my $dbpass;
>> my @row;
>> my $foo;
>> my $line;
>> my $count;
>> my $found;
>
> Define them in the smallest scope.
>
>> Define();
> init(); ???
>
>>
>> my $query="SELECT `cname`,`mainurl` FROM `ispdata` WHERE `mainurl` IS
>> NOT NULL AND `mainurl` != \"http://\" AND `approved` = 1 ORDER BY
>> `cname`";
>
> No need for all that extra noise.
>
> my $query = qq{
> select cname, mainurl
> from ispdata
> where mainurl is not NULL and
> mainurl != "http://" and
> approved = 1
> order by cname
> };
>> my $dbh;
>> my $sth;
>> $dbh = DBI->connect("DBI:mysql:$dbname", $dbuser, $dbpass,{PrintError
>> => 1, RaiseError => 1});
>> $sth=$dbh->prepare($query);
>> $sth->execute();
>> while (@row=$sth->fetchrow()) {
>> $row[0]=uri_unescape($row[0]);
>> $row[1]=uri_unescape($row[1]);
>
> Set these to something that makes sense.... $cname and $mainurl???
>
>> $foo='http://';
>> $row[1]=~ s/$foo//g;
> Since you're using the same value, either define
> $foo outside the while, probably using a better name,
> or simply use it in the substitution.
>
>> my @url;
> You could place that within the following if() and if you simply want
> the first item from split you don't need it at all.
> $row[1] = ( split '/', $row[1] ) [0]; # or $row[1] =~ s{/.*}{};
>> if ($row[1] =~ /\//) {
>> @url=split /\//,$row[1];
>> $row[1]=$url[0];
>> }
>> $row[1]=~ s/ //g;
>> $hosts{$row[0]}=$row[1];
>> }
>> $sth->finish;
>> $dbh->disconnect;
>
> For the rest I'd suggest taking a look at an article written by Randal
> Schwartz, especially the validate_links subroutine:
>
> http://www.stonehenge.com/merlyn/UnixReview/col56.html
>
> adding a call to HEAD, which you can parse as needed, you could
> replace your entire loop by a slightly modified version of that
> subroutine.
>
Thanks to both you and Xho, I was able to refine the code a bit to make
the timeouts a bit more palateable in that I could watch the output and
remove ISPs from the DB who either weren't in business anymore or didn't
have a webserver up and running (which I am assuming is the same thing :)
)
I just couldn't wrap my head around the LWP::Parallel stuff, at least not
to get a timeout on the read/responses, but I got the desired end result,
though it took me quite a while :)
For those interested in the data collected, it's here, along with a thank
you mention to Xho and J Gleixner:
http://www.canadianisp.com/isp_server_types.html
The quick summary, however: (These are ISPs serving Canada, only)
ISPs queried: 355
ISPs who's servers responded: 322 (resulting in 33 ISPs being removed
from CanadianISP.com)
ISPs who's servers responded, but with no Server: information: 14
Server Responses:Apache 212 66% (We have a winner!)
Microsoft IIS 78 24%
Zeus 5 2%
Netscape Enterprise 2 0.6%
NCSA 1 0.3%
Sun ONE Webserver 1 0.3%
WebSTAR 1 0.3%
Zope 1 0.3%
Thanks again!
--
Marc Bissonnette
Looking for a new ISP? http://www.canadianisp.com
Largest ISP comparison site across Canada.
------------------------------
Date: 28 Nov 2006 04:58:33 -0800
From: "Brian McCauley" <nobull67@gmail.com>
Subject: Re: How to get the DOM from a XML page
Message-Id: <1164718713.914042.136040@j44g2000cwa.googlegroups.com>
On Nov 27, 11:54 am, "novos...@googlemail.com"
<novos...@googlemail.com> wrote:
> Hello guys,
> I want to get the DOM of an XML page.for eg:an XML
> page, being converted from HTML using Tidy,is:
>
> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
> <html>
> <head>
> <meta name="generator" content=
> "HTML Tidy for Windows (vers 14 February 2006), seewww.w3.org">
> <title></title>
> </head>
> <body>
> </body>
> </html>
Excuse me stating the obvious but that's not XML, it's HTML. It's tidy
HTML but still HTML. IIRC it's possible to instruct "tidy" to emit
xhtml (which is XML).
------------------------------
Date: 28 Nov 2006 14:33:35 GMT
From: MI5-Victim@mi5.gov.uk
Subject: MI5 Persecution: bugging and counter-surveillance
Message-Id: <m06102815281164@4ax.com>
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
-= MI5: bugging and counter-surveillance -=
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
PO: >Did you ever look for the bugs in your house ? If not, why not ? I mean if
PO: >I thought that was happening to me, I'd search the place from top to bottom,
PO: >I mean I live there I would know if anything was out of place. If I was
PO: >really suspicious, I would call in one of those bug detection teams which
PO: >have those machines that pick up the transmitted radio waves. This
PO: >reminds me of BUGS, that new programme on BBC1 on
That's exactly what we did. We went to a competent, professional detective
agency in London, paid them over 400 quid to debug our house. They used
scanner devices which go to over 1 GHz and would pick up any nearby
transmitter in that range, they also checked the phones and found
nothing... but if the tap was at the exchange, then they wouldn't find
anything, would they?
CS: >Doesn't this suggest to you that there are, in fact, no bugs to be found?
You can assume that they've done this sort of thing to other people in more
"serious" cases, where they would know the targets would suspect the
presence of electronic surveillance. So they will have developed techniques
and devices which are not readily detectable either by visual inspection or
by electronic means. What those techniques might be, I couldn't guess.
In this case, the existence of bugging devices was clear from the
beginning, and they "rubbed it in" with what was said by the boy on the
coach. It was almost as if they wanted counter-surveillance people to be
called in, who they knew would fail to detect the bugging devices, causing
loss of credibility to the other things I would have to say relating to the
harassment.
I did all the things someone in my situation would do to try to find the
bugs. In addition to calling in professional help using electronic
counter-surveillance, I made a close visual inspection of electrical
equipment, plus any points where audio or video surveillance devices might
have been concealed. Of course, I found nothing. Normal surveillance
"mini-cameras" are quite noticeable and require visible supporting
circuitry. It seems to me the best place to put a small video surveillance
device would be additional to a piece of electronic equipment such as a TV
or video. It would be necessary to physically break in to a property to fit
such a device.
434
--
Posted via a free Usenet account from http://www.teranews.com
------------------------------
Date: 28 Nov 2006 14:50:33 GMT
From: MI5-Victim@mi5.gov.uk
Subject: MI5 Persecution: cost of the operation
Message-Id: <m06102815451015@4ax.com>
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-= MI5: cost of the operation -=
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Here's what a couple of other people on Usenet (uk.misc) had to say
regarding the cost of running such an operation...
PO: >Have some sense, grow up and smell reality. What you are talking about
PO: >would take loads of planning, tens of thousands of pounds and lots of
PO: >people involved in the planning, execution and maintenance of it. You
PO: >must have a very high opinion of yourself to think you are worth it.
PM: >But why? And why you? Do you realize how much it would cost to keep
PM: >one person under continuous surveillance for five years? Think about
PM: >all the man/hours. Say they _just_ allocated a two man team and a
PM: >supervisor. OK., Supervisor's salary, say, #30,000 a year. Two men,
PM: >#20,000 a year each. But they'd need to work in shifts -- so it would
PM: >be six men at #20,000 (which with on-costs would work out at more like
PM: >#30,000 to the employer.)
PM: >
PM: >So, we're talking #30,000 x 6. #180,000. plus say, #40,000 for the
PM: >supervisor. #220,000. Then you've got the hardware involved. And
PM: >any transcription that needs doing. You don't think the 'Big Boss'
PM: >would listen to hours and hours of tapes, do you.
PM: >
PM: >So, all in all, you couldn't actually do the job for much less than
PM: >a quarter million a year. Over five years. What are you doing that makes
PM: >it worth the while of the state to spend over one and a quarter million
PM: >on you?
Those are pretty much the sort of calculations that went through my head
once I stopped to consider what it must be costing them to run this
operation. The partial answer is, there have been periods when the
intensity has been greater, and times when little has happened. In fact,
for much of 1993 and the first half of 1994, very little happened. Although
I don't think that was for reasons of money - if they can tap into the
taxpayer they're not going to be short of resources, are they?
The more complete answer is in the enormity of what they're doing. Relative
to the cost to British pride of seeing their country humiliated for the
persecution of their own citizens, isn't is worth the cost of four or five
people to try to bring things to a close in the manner they would wish? To
the government a million or two is quite honestly nothing - if they can
convince themselves of the necessity of what they're doing, resources will
not be the limiting factor.
436
--
Posted via a free Usenet account from http://www.teranews.com
------------------------------
Date: 28 Nov 2006 15:00:41 GMT
From: MI5-Victim@mi5.gov.uk
Subject: MI5 Persecution: how and why did it start?
Message-Id: <m06102815551843@4ax.com>
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
-= how and why did it start? -=
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
The harassment didn't start by itself, so someone must have been there at
the outset to give it a firm push and set the "animals" after me. It looks
as if I was set up in June 1990, and the timing indicates someone from
university was responsible.
>One thing which has been missing from this discussion is this simple
>prognosis: that maybe he is right and that, despite his admitted
>mental condition, there really is a campaign against him organised by
>now-influential ex-students of his university.
In May or June 1990, Alan Freeman on Radio 1 read out a letter from someone
who had known me for a few years, who wrote of the one who "wore out his
welcome with random precision" (from the Pink Floyd song). Freeman went on
to say to the writer "that's a hell of a letter you wrote there". The
indication is strongly that people I had parted from soon before nursed a
grudge against me and were trying to cause trouble for me.
The suggestion is that Freeman might have shown the letter to other people,
and things could have snowballed from there. Right from the start the real
source (security services presumed) didn't announce themselves as the
origin, but let the "talkers", the radio DJs, believe that they were the
originators. Think about it; if you announce, "we're MI5 and we have a
campaign against this bloke" then people might not go along with it; but if
you say, "everyone else is getting at this bloke because he 'deserves' it"
then people will join in with fewer qualms.
>Why would "they" wish to assassinate your character?
It's the classic case of hitting a cripple to prove you're stronger. Why
would the security services expend hundreds of thousands of pounds and more
than six years of manpower to try to kill a British citizen? Because they
are motivated by people who knew me at university and feel personal
animosity; because they knew me to be emotionally weak, and it is in the
nature of bullies to prey on those known to be weak; and because they can
rely on the complicity of the establishment, which the security services
manipulate and derive funding from. This is England's biggest humiliation
today, and the British security services are intent on preventing their
humiliation becoming reality by continuing their campaign of attempted
murder to suppress the truth from becoming public.
435
--
Posted via a free Usenet account from http://www.teranews.com
------------------------------
Date: 28 Nov 2006 13:43:50 GMT
From: MI5-Victim@mi5.gov.uk
Subject: MI5 Persecution: the BBC, television and radio
Message-Id: <m06102814382720@4ax.com>
-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=
-= the BBC, television and radio -=
-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=
The first incident in June 1990 was when a BBC newsreader made what seemed
to be a reaction to something which had happened in my home, and out of
context of what they were reading. My first reaction was disbelief; nothing
of the sort had ever happened before, the idea that such a thing could
occur had not crossed my mind, yet there was no doubt of what had just
taken place. My disbelief eroded as this recurred time after time. Besides
the news, offenders included shows such as Crimewatch (!), Newsnight, and
"entertainment" shows. There seems to be very little moral understanding
among the people who make these programmes; they just assume they will
never be caught, so they carry on without a thought for the illegality or
amorality of what they do. The only time I ever heard a word raised in
doubt was by Paxman being interviewed by someone else (I think by Clive
Anderson) back in 1990; referring to the "watching" he said it troubled
him, and when asked by the host what you could do about it, replied "Well,
you could just switch it off" (meaning the surveillance monitor in the
studio). He clearly didn't let his doubts stand in the way of continued
surreptitious spying from his own or other people's shows, though.
Now you're convinced this is a troll, aren't you? This story has been the
subject of much debate on the uk.* Usenet newsgroups for over a year, and
some readers believe it to be an invention (it has even been suggested that
a group of psychology students are responsible!), others think it
symptomatic of a derangement of the author, and a few give it credence.
Quite a few people do know part or all of the story already, so this text
will fill in the gaps in their knowledge. For the rest, what may persuade
you of the third possibility is that some of the incidents detailed are
checkable against any archives of radio and TV programmes that exist; that
the incidents involve named people (even if those hiding in the shadows
have not made their identity or affiliations evident), and those people
may be persuaded to come out with the truth; and that the campaign of
harassment is continuing today both in the UK and on the American
continent, in a none-too-secret fashion; by its nature the significant risk
of exposure increases with time.
On several occasions people said to my face that harassment from the TV was
happening. On the first day I worked in Oxford, I spent the evening in the
local pub with the company's technical director Ian, and Phil, another
employee. Ian made a few references to me and said to Phil, as if in an
aside, "Is he the bloke who's been on TV?" to which Phil replied, "Yes, I
think so".
I made a number of efforts to find the bugs, without success; last year we
employed professional counter-surveillance people to scan for bugs (see
later) again without result. In autumn 1990 I disposed of my TV and watched
virtually no television for the next three years. But harassment from TV
stations has gone on for over six years and continues to this day. This is
something that many people obviously know is happening; yet the TV staff
have the morality of paedophiles, that because they're getting away with it
they feel no wrong.
Other people who were involved in the abuse in 1990 were DJs on BBC radio
stations, notably disc jockeys from Radio 1 and other stations (see the
following section). Again, since they don't have sense in the first place
they can't be expect to have the moral sense not to be part of criminal
harassment.
436
--
Posted via a free Usenet account from http://www.teranews.com
------------------------------
Date: 28 Nov 2006 06:56:53 -0800
From: "banker123" <bradbrockman@yahoo.com>
Subject: Re: Multi Line Match and Regex
Message-Id: <1164725813.694944.34570@j72g2000cwa.googlegroups.com>
John Bokma wrote:
> You might want to study
>
> perldoc perldsc
I will take a look, thanks!
------------------------------
Date: 28 Nov 2006 08:10:21 GMT
From: tadmc@augustmail.com
Subject: Posting Guidelines for comp.lang.perl.misc ($Revision: 1.7 $)
Message-Id: <456beeed$0$81353$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.7 $)
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://www.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 that they do
know and are being the "bad kind" of Lazy.
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: 28 Nov 2006 07:51:26 -0800
From: "Mr P" <MisterPerl@gmail.com>
Subject: PS: Expression problem
Message-Id: <1164729086.941142.45750@n67g2000cwd.googlegroups.com>
>
> The $details array is read in from a text file and this works fine.
> What I want to do is search the $details text for certain key words,
> then take the text right after. The first if statement
.
.
I just noticed this comment about reading from a file, although you
don't show your code for that. I will share this approach which works
well for me and my team, and is nice and tidy. I call it the guerilla
approach- get into the file, snag it, get out!
die "This file will not open here is why: \n$!\n" unless open T,
'mytextfile.txt';
my @details = <T>;
close T;
for ( @details )
{
.
.
.
}
If you REALLY want a lot of info about the file and failure, you can
use some cool Perl file tests:
# lots of details...
die "aint no such file as $myFile\n" unless -e $myFile;
die "$myFile is a directory not a file!\n" unless -d $myFile;
die "the file $myFile is there but I cannot read it\n" unless -r
$myFile;
die "the file $myFile is there but I cannot open it for reading
(locked maybe?)\n$!\n"
unless open T, $myFile;
my @details = <T>;
close T;
die "I opened and read $myFile but there wasnt nothing in it, wanna
try again ace?\n"
unless @details;
Welcome to the wonderful world of Perl, you make a wise choice
grasshopper!
PS: do you own due-diligence on my and other comments and suggestions
and choose what works best for you. Larry often states that in Perl
there are MANY ways to do things. Often you'll see a lot of approaches
to questions here in CLPM - study them and choose the best for you.
Although I've read Llama, Camel, even big black cat, I would still say
that I've learned 75% of my Perl right here in this group. Often I'll
slap my forehead after seeing a reply and think "DUH how did I MISS
that!"..
------------------------------
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 10013
****************************************