[24482] in Perl-Users-Digest
Perl-Users Digest, Issue: 6664 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jun 8 09:05:46 2004
Date: Tue, 8 Jun 2004 06:05:06 -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, 8 Jun 2004 Volume: 10 Number: 6664
Today's topics:
Re: ANSI Screen escape sequences <dickey@saltmine.radix.net>
Converting a string to multiple search patterns <tore@aursand.no>
Re: Converting a string to multiple search patterns (Anno Siegel)
Free perl IDE? - Don't shoot! <roger1023@yahoo.com>
Re: Free perl IDE? - Don't shoot! <usenet@morrow.me.uk>
Re: killing my children (Anno Siegel)
Re: Need help installing WWW-Search-Ebay-2.193 Module.. <grizelda_bone@yahool.com>
Re: Need help installing WWW-Search-Ebay-2.193 Module.. <usenet@morrow.me.uk>
Re: Need help running shell commands <josef.moellers@fujitsu-siemens.com>
Newbie (Sree)
Re: Newbie <ittyspam@yahoo.com>
Re: Newbie <bernard.el-haginDODGE_THIS@lido-tech.net>
Re: No-install Perl Interpretor (Richard Williams)
Re: No-install Perl Interpretor <mick.lan@laposte.net>
Posting Guidelines for comp.lang.perl.misc ($Revision: tadmc@augustmail.com
Re: Using LWP to get last modified date of web page <rbell01824@earthlink.net>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 08 Jun 2004 12:54:10 -0000
From: Thomas Dickey <dickey@saltmine.radix.net>
Subject: Re: ANSI Screen escape sequences
Message-Id: <10cbdni7p03f77b@corp.supernews.com>
In comp.lang.perl.misc Ben Morrow <usenet@morrow.me.uk> wrote:
> Quoth Joe Smith <Joe.Smith@inwap.com>:
>> Ben Morrow wrote:
>>
>> > use Term::ANSIScreen qw/:screen :cursor/;
>> >
>> > locate 1, 1;
>> > cls;
>> > print "...";
>> >
>> > For some reason I have found that both cls and clline only work for me
>> > if I locate to the start of the region to be cleared first.
>>
>> That's a bug in your terminal emulator; it is not responding to escape
>> sequences as per the ANSI specs.
>>
>> cldown = "\x33[0J" = clear from location to end of screen
>> clup = "\x33[1J" = clear from beginning of screen to location
>> cls = "\x33[2J" = clear the entire screen
> I suspected as much. I didn't *really* think it likely that there would
> be a bug in a module as simple as Term::ANSIScreen :).
>> > presuming this is a bug in the linux console driver :) .
>>
>> Works fine with xterm, gnome-terminal, and the Linux 2.4.20 console.
> Linux 2.6.3 console, in UTF-8 mode. I suspect the latter may be the
> problem...
...or the perl script (the defect you're describing is a well-known defect
of the so-called "ansi.sys" - perhaps someone made the perl script follow it).
--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net
------------------------------
Date: Tue, 08 Jun 2004 12:18:58 +0200
From: Tore Aursand <tore@aursand.no>
Subject: Converting a string to multiple search patterns
Message-Id: <pan.2004.06.08.10.18.57.112315@aursand.no>
Hi all!
I'm stumped on this one: I have an application where I need to refine the
search mechanism. The concept is quite simple: Get a string, convert it
to separate words, count (and "score") each word for each document, and
then display the result based on the score;
my $query = 'A B C D';
my @words = split( /\s+/, $query );
foreach ( @documents ) {
# ...
}
I need to refine it, as said. I want a higher score for word sequences,
and in a particular order. For the example above ('A B C D'), I want to
match in this order:
1. A B C D
2. A B C
3. B C D
4. A B
5. C D
6. A C
7. B D
9. A D
9. A
10. B
11. C
12. D
Anyone know of a module which can accomplis this? I really haven't tried
with anything yet, 'cause I have no clue on how to do it. The closest
thing I've been, has been with the Algorithm::Permute module. It doesn't
give me what I want "out of the box", though...
Any ideas?
--
Tore Aursand <tore@aursand.no>
"Progress is made by lazy men looking for easier ways to do things."
(Robert Heinlein)
------------------------------
Date: 8 Jun 2004 11:53:53 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Converting a string to multiple search patterns
Message-Id: <ca49ch$lfl$1@mamenchi.zrz.TU-Berlin.DE>
Tore Aursand <tore@aursand.no> wrote in comp.lang.perl.misc:
> Hi all!
>
> I'm stumped on this one: I have an application where I need to refine the
> search mechanism. The concept is quite simple: Get a string, convert it
> to separate words, count (and "score") each word for each document, and
> then display the result based on the score;
>
> my $query = 'A B C D';
> my @words = split( /\s+/, $query );
> foreach ( @documents ) {
> # ...
> }
>
> I need to refine it, as said. I want a higher score for word sequences,
> and in a particular order. For the example above ('A B C D'), I want to
> match in this order:
>
> 1. A B C D
> 2. A B C
> 3. B C D
> 4. A B
> 5. C D
> 6. A C
> 7. B D
> 9. A D
> 9. A
> 10. B
> 11. C
> 12. D
I'm missing "A B D", "A C D", and " B C " from the collection.
Are these entirely arbitrary?
> Anyone know of a module which can accomplis this? I really haven't tried
> with anything yet, 'cause I have no clue on how to do it. The closest
> thing I've been, has been with the Algorithm::Permute module. It doesn't
> give me what I want "out of the box", though...
I'm not sure what you are asking. Is it the generation of all selections
of 1 .. 4 objects from a set of 4? These don't correspond to permutations,
but to four-digit binary numbers (so there are 2**4 - 1 = 15 of them,
not counting the empty selection). I'm sure there is a module on CPAN
to generate them, but ad-hoc solutions aren't too hard either.
Or is the issue how to assign a score to each of a collection of
regexes and retrieve the score after each match? This can be done
using the (?{}) construct to execute code at match time.
Starting from your list (@lines, say) above, I'd generate a list @score
of pairs where each pair holds a score and a string to match:
my @score = map [ split /\./], @lines;
$_->[ 1] =~ tr/ //d for @score;
The second line simplifies things by deleting all blanks from the strings
to match. Your practical regexes may look different.
Build an alternation of patterns where each pattern includes code
to set a variable ($scored) to the corresponding score:
my $rex = join '|', map "$_->[ 1](?\{ \$scored = $_->[ 0] \})", @score;
Generate a test string and check it.
my $text = join '', map qw( A B C D E)[ rand 5], 1 .. 100;
my $scored;
use re 'eval';
while ( $text =~ /($rex)/g ) {
print "score $scored: $1\n";
}
Anno
------------------------------
Date: 07 Jun 2004 15:44:26 GMT
From: Roger <roger1023@yahoo.com>
Subject: Free perl IDE? - Don't shoot!
Message-Id: <200467-174426-80953@foorum.com>
I know this question has been answered repeatedly since at least 1998.
I also know there is a section of the FAQ with info on this.
I have been using Open Perl IDE, it can be found on source forge and I find it
to be very very good.
My question is -- Is this thing really free?
It's says it is "Open Source Software, Distributed under the Mozilla Public
License 1.1"
I am not sure *exactly* if that means it's free for non-personal use.
I actually read all of the license (whew!) and after I was finished, I still
didn't know. I even read the FAQ but to no avail. There is much about adding
code to it, and extending it, and such as that, but all I wanted to know is....
is it absolutely 100% free for non-personal USE only, I am not interested nor
have I the skill to extend it's developement.
TIA
--
Use our news server 'news.foorum.com' from anywhere.
More details at: http://nnrpinfo.go.foorum.com/
------------------------------
Date: Tue, 8 Jun 2004 11:04:47 +0000 (UTC)
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: Free perl IDE? - Don't shoot!
Message-Id: <ca46gf$6hl$1@wisteria.csv.warwick.ac.uk>
Quoth Roger <roger1023@yahoo.com>:
> I have been using Open Perl IDE, it can be found on source forge and I find it
> to be very very good.
>
> My question is -- Is this thing really free?
>
> It's says it is "Open Source Software, Distributed under the Mozilla Public
> License 1.1"
>
> I am not sure *exactly* if that means it's free for non-personal use.
>
> I actually read all of the license (whew!) and after I was finished, I still
> didn't know. I even read the FAQ but to no avail. There is much about adding
> code to it, and extending it, and such as that, but all I wanted to know is....
> is it absolutely 100% free for non-personal USE only, I am not interested nor
> have I the skill to extend it's developement.
Yes. All use is absolutely free. Most of the license covers distributing
modified versions, either in source or binary form.
(standard disclaimer: I Am Not A Lawyer, if you need to know this for
your company you'd be best off getting the legal department to check it
it so it's not your fault, etc. etc.)
Ben
--
We do not stop playing because we grow old;
we grow old because we stop playing.
ben@morrow.me.uk
------------------------------
Date: 8 Jun 2004 08:47:35 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: killing my children
Message-Id: <ca3uf7$e5i$1@mamenchi.zrz.TU-Berlin.DE>
Ben Morrow <usenet@morrow.me.uk> wrote in comp.lang.perl.misc:
> END {
> if ($parent = $$) {
^
You mean "==".
> kill TERM => $_ for @kids;
> }
> }
Anno
------------------------------
Date: Tue, 08 Jun 2004 08:47:20 GMT
From: The Moor Of Venice <grizelda_bone@yahool.com>
Subject: Re: Need help installing WWW-Search-Ebay-2.193 Module...
Message-Id: <s2fxc.25132$Gx4.21924@bgtnsc04-news.ops.worldnet.att.net>
Randy Kobes wrote:
> "The Moor Of Venice" <grizelda_bone@yahool.com> wrote in message
> news:ku3xc.45022$_k3.1122038@bgtnsc05-news.ops.worldnet.att.net...
>
>>Hi all. I am trying to install the WWW-Search-Ebay-2.193 Module that I
>>nicked off CPAN. One of the O'Reilly Books has a script that calls this
>>module. Here's the problem: I am trying to do it under Windows, from
>>the Windows command line. <puts on flame proof suit and dodges rotten
>>tomatoes>.
>>
>>It's not a pre-built module. ActivePerl's PPM won't let me do it.
>
> [ ... ]
> What version of ActivePerl are you using? I just tried it on
> a box running ActivePerl 806, and a ppm package for
> WWW-Search-Ebay (version 2.17) was found, and it
> installed fine, including all the required dependencies.
>
> best regards,
> randy kobes
>
>
>
yes but the version the script requires is WWW-Search-Ebay-2.193. See,
Ebay changes it's search format every few weeks, so the author has to
alter the module to allow for the changes...
heck, here's the script, see if you can get it running. I'm trying to
run it on Windows 2000. I've tried everything that someone who has no
idea what he is doing and is blindly swinging in the dark can try to
make the bastarding thing work. And God help me, it WON'T.
There is a version with the whole schmeer, scraper and all, called, let
me see, Bundle-WWW-Scraper-Auction-0.01. That is supposedly
installable from the CPAN prompt (of course, I don't really even
understand what that prompt IS--I just enter the Windows command line
and go to the Perl directory and type CPAN. I think it's a command line
module that allows me to directly access the CPAN archive, but I don't
know where it came from or what I did to install it) but that doesn't
seem to work. I get an error message that I don't understand. I also
try running a
perl prereqinst
command, and it installs a lot of stuff and then tells me I need HTML
Tidy. I got HTML Tidy and unpacked it but I still get that message.
And there my educated guesses about what to do run out.
I understand computers in general but specific stuff stymies me. At
least specific stuff younger than 20 years old :-). Let me program in
6502 Assembler Code and I'll knock your socks off and I'm a whiz with a
Xerox 280. But this "new" stuff (:P)--well, let's just say I'm
learning. And I appreciate all the help anyone can give me.
Dave
P.S. In this code listing, the module it calls is the module you
mentioned. But it's wrong, I just didn't bother to modify it. Like I
said, you end up modifying it every couple of weeks.
Please also remember in your reply that I am running Windoze. If I was
running Linux I would have got this running and moved on last week. :P
Dave
#!/usr/bin/perl
$searchstring = "NIKON";
$email = "berlin.david@worldnet.att.net";
$localfile = "C:/searchresults.txt";
use WWW::Search;
$searchobject = new WWW::Search('Ebay');
$query = WWW::Search::escape_query($searchstring);
$searchobject->native_query($query);
# *** put results into two arrays ***
$a = 0;
while ($resultobject = $searchobject->next_result()) {
$a++;
($itemnumber[$a]) = ($resultobject->url =~ m!item=(\d+)!);
$title[$a] = $resultobject->title;
}
# *** eliminate entries already on file ***
open (INFILE,"$localfile"); while ( $line = <INFILE> ) {
for ($b = $a; $b >= 1; $b--) {
if ($line =~ $itemnumber[$b]) {
splice @itemnumber, $b, 1; splice @title, $b, 1;
}
}
}
close (INFILE);
$a = @itemnumber - 1;
if ($a == 0) { exit; }
# *** save any remaining new entries to file ***
open (OUTFILE,">>$localfile");
for ($b = 1; $b <= $a; $b++) {
print OUTFILE "$itemnumber[$b]\n|";
}
close (OUTFILE);
------------------------------
Date: Tue, 8 Jun 2004 11:14:35 +0000 (UTC)
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: Need help installing WWW-Search-Ebay-2.193 Module...
Message-Id: <ca472r$6hl$2@wisteria.csv.warwick.ac.uk>
Quoth The Moor Of Venice <grizelda_bone@yahool.com>:
> Randy Kobes wrote:
>
> > "The Moor Of Venice" <grizelda_bone@yahool.com> wrote in message
> > news:ku3xc.45022$_k3.1122038@bgtnsc05-news.ops.worldnet.att.net...
> >
> >>Hi all. I am trying to install the WWW-Search-Ebay-2.193 Module that I
> >>nicked off CPAN. One of the O'Reilly Books has a script that calls this
> >>module. Here's the problem: I am trying to do it under Windows, from
> >>the Windows command line. <puts on flame proof suit and dodges rotten
> >>tomatoes>.
> >>
> >>It's not a pre-built module. ActivePerl's PPM won't let me do it.
> >
> > What version of ActivePerl are you using? I just tried it on
> > a box running ActivePerl 806, and a ppm package for
> > WWW-Search-Ebay (version 2.17) was found, and it
> > installed fine, including all the required dependencies.
> >
> yes but the version the script requires is WWW-Search-Ebay-2.193. See,
> Ebay changes it's search format every few weeks, so the author has to
> alter the module to allow for the changes...
>
> heck, here's the script, see if you can get it running. I'm trying to
> run it on Windows 2000. I've tried everything that someone who has no
> idea what he is doing and is blindly swinging in the dark can try to
> make the bastarding thing work. And God help me, it WON'T.
Install nmake (see my previous post). Make sure it is in your path, as
nmake.exe.
At the command prompt, run
perl -MCPAN -e"install WWW::Search::Ebay"
This ought to install everything; you may need to find and install
command-line tar and gzip programs from somewhere, or install
Archive::Tar and IO::Zlib with ppm.
> There is a version with the whole schmeer, scraper and all, called, let
> me see, Bundle-WWW-Scraper-Auction-0.01. That is supposedly
> installable from the CPAN prompt (of course, I don't really even
> understand what that prompt IS--I just enter the Windows command line
> and go to the Perl directory and type CPAN. I think it's a command line
> module that allows me to directly access the CPAN archive, but I don't
> know where it came from or what I did to install it) but that doesn't
> seem to work. I get an error message that I don't understand.
Well, we won't understand it either if you don't say what it was, will
we?
Ben
--
Outside of a dog, a book is a man's best friend.
Inside of a dog, it's too dark to read.
ben@morrow.me.uk Groucho Marx
------------------------------
Date: Tue, 08 Jun 2004 09:15:23 +0200
From: Josef Moellers <josef.moellers@fujitsu-siemens.com>
Subject: Re: Need help running shell commands
Message-Id: <ca3oth$n1$1@nntp.fujitsu-siemens.com>
Gregory Toomey wrote:
> Ben Morrow wrote:
>=20
>=20
>>Quoth john_20_28_2000@yahoo.com (jm):
>>
>>>I have my perl file set up as 4711 and am running it as root.
> I dont have a clue what he wants. 4711 is a brand of aftershave.
Not only an aftershave but a whole series of fragrances, body lotions,=20
aftershaves etc.
Named after the number of the company's house in the Glockengasse in=20
Cologne (Germany). A specific product of 4711 is often referred to as=20
"Eau de Cologne" (Water of Cologne), mainly used by old spinsters B-{).
(No, I do not work for 4711).
Besides: Setting any the permission triples of an interpreted script to=20
1 is pretty senseless: the interpreter will be unable to read the=20
script's code:
Can't open perl script "./x.pl": Permission denied
Josef
--=20
Josef M=F6llers (Pinguinpfleger bei FSC)
If failure had no penalty success would not be a prize
-- T. Pratchett
------------------------------
Date: 8 Jun 2004 04:11:16 -0700
From: serverin2000@yahoo.com (Sree)
Subject: Newbie
Message-Id: <e9936b79.0406080311.744291c0@posting.google.com>
Hi all,
I am new to this perl scripting language.Please help me in starting
this.(by giving some URLs and some good books name).If you can tell me
how strong this language is, it would be appreciated.
regards
Sree
------------------------------
Date: Tue, 8 Jun 2004 07:23:42 -0400
From: Paul Lalli <ittyspam@yahoo.com>
Subject: Re: Newbie
Message-Id: <20040608072145.Y8971@dishwasher.cs.rpi.edu>
On Tue, 8 Jun 2004, Sree wrote:
> Hi all,
> I am new to this perl scripting language.Please help me in starting
> this.(by giving some URLs and some good books name).If you can tell me
> how strong this language is, it would be appreciated.
>
> regards
> Sree
http://www.perl.com
http://www.perldoc.com/perl5.6/pod/perl.html (this is your intro)
http://www.perldoc.com/perl5.6/pod/perlfaq2.html#Perl-Books (this is your
list of the best books)
Paul Lalli
------------------------------
Date: Tue, 8 Jun 2004 13:22:54 +0200
From: "Bernard El-Hagin" <bernard.el-haginDODGE_THIS@lido-tech.net>
Subject: Re: Newbie
Message-Id: <Xns95028866A410Celhber1lidotechnet@62.89.127.66>
serverin2000@yahoo.com (Sree) wrote:
> Hi all,
> I am new to this perl scripting language.Please help me in
> starting
> this.(by giving some URLs and some good books name).If you can
> tell me how strong this language is, it would be appreciated.
It can lift a two ton truck with its bare hands.
--
Cheers,
Bernard
------------------------------
Date: Tue, 8 Jun 2004 09:38:17 +0000 (UTC)
From: rdwillia@hgmp.mrc.ac.uk (Richard Williams)
Subject: Re: No-install Perl Interpretor
Message-Id: <ca41e9$bn2$1@helium.hgmp.mrc.ac.uk>
In article <40c50c71@news.victoria.tc.ca>,
Malcolm Dew-Jones <yf110@vtn1.victoria.tc.ca> wrote:
>Micla (mick.lan@laposte.net) wrote:
>
>: Would anybody know a Perl version usable without any prior installation?
>
>The keys files required by perl are very few.
>
>On windows, for example, you need perl.exe and perhaps one .DLL file
>(perhaps another as well). If you have those files in your path then you
>can write and run perl scripts without any kind of install, and without
>taking up much space. Of course you can't use modules, unless you also
>include them somewhere, but so what, perl by itself is still extremely
>useful for things like mass batch editing of files and flexible filtering
>etc.
Tinyperl extends this approach for Windows by also including a
small library of core modules (compressed as a single file that can be
rebuilt with additional modules if required). The Tinyperl interpreter can
be used in the normal way to run standard scripts, or you can (optionally)
use the package to build standalone executables containing the
interpreter.
Indigoperl may be another option:
http://www.indigostar.com/indigoperl.htm
AFAIR the installation script is optional (or was in older versions) if
you specify the path manually. You should be able to get the whole thing
on a reasonably-sized USB key.
Richard.
------------------------------
Date: Tue, 08 Jun 2004 12:08:34 +0200
From: Micla <mick.lan@laposte.net>
Subject: Re: No-install Perl Interpretor
Message-Id: <ca436t$bat$1@s1.read.news.oleane.net>
Micla a écrit :
>
> Would anybody know a Perl version usable without any prior installation?
>
> One of the goals foreseen for it would be to have some "personal"
> scripts on a USB memory key, immediately usable on any computer that I
> have the opportunity to go on.
>
> But there are also other reasons to try to use Perl scripts without
> installing Perl previously.
>
> Thank's for any help.
>
> Me.
Thank's for all these replies !
In fact, the extract of the minimal set of executables from Perl seems
to be the most efficient way to meet my requirement.
I will investigate to determine precisely what are the files needed. If
anybody has the list of them, thank's by advance !
Another point : I have to use my key and my scripts on "office" machines
which are securised and which I cannot reboot or install software on.
That'a also a reason fo me to look after "portable" and "uninstalled"
solutions.
Thank's to the community !
Micla.
------------------------------
Date: Tue, 08 Jun 2004 02:23:56 -0500
From: tadmc@augustmail.com
Subject: Posting Guidelines for comp.lang.perl.misc ($Revision: 1.5 $)
Message-Id: <79KdnQGPIfQR9FjdRVn-jg@august.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, 08 Jun 2004 12:48:37 GMT
From: Richard Bell <rbell01824@earthlink.net>
Subject: Re: Using LWP to get last modified date of web page
Message-Id: <96dbc05rpvr7rnpj95nkreisk5ogosb385@4ax.com>
On Mon, 07 Jun 2004 15:40:02 GMT, Uri Guttman <uri@stemsystems.com>
wrote:
>>>>>> "AB" == Andrew Bryson <andrew@bryson.co.nz> writes:
>
> AB> On Sat, 05 Jun 2004 18:26:29 +0000, Joe Smith wrote:
> >> Spiders and crawlers download the entire page.
> >> In some cases, the date is the last time it went looking
> >> instead of the file's date.
>
>huh? some spiders do a HEAD first to avoid downloading a page that
>hasn't changed. you compare the date from the HEAD with the date of the
>file the last time you downloaded it. you have to assume the web server
>is returning accurate and proper file timestamps.
>
> AB> I would hope that in all cases they would use the time they last
> AB> went looking... otherwise they would not be accurate at all.
>
>not last looking but last modified of the fetched page. there is a last
>modified field in http requests which also does this. you get a not
>modified result instead of the page if it hasn't changed since you last
>got it. again, this needs the server to behave nicely and not all do.
>
>uri
In my experience (currently working with about 6000 sites) HEAD and
related matters are as honored in the breach as not. There are some
sites that respond with what is by all appearances good data. Others
do not respond at all. Still others, respond with what is clearly
bogus data (sometimes synthesized, other times just plain lies).
While your milage may vary, in my experience, if you want to know
what's on a page today, download it today.
------------------------------
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 6664
***************************************