[30698] in Perl-Users-Digest
Perl-Users Digest, Issue: 1943 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Oct 24 06:09:39 2008
Date: Fri, 24 Oct 2008 03:09:07 -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 Fri, 24 Oct 2008 Volume: 11 Number: 1943
Today's topics:
Re: can LWP handle this? <dontmewithme@got.it>
Re: Comparison of two files.. <jimsgibson@gmail.com>
Re: Comparison of two files.. <jurgenex@hotmail.com>
Re: Filehandle STDIN reopened as $fh1 only for output <whynot@pozharski.name>
Help: Nested quantifiers in regex Problem <openlinuxsource@gmail.com>
Re: Help: Nested quantifiers in regex Problem <someone@example.com>
Re: Help: Nested quantifiers in regex Problem <mgjv@heliotrope.com.au>
new CPAN modules on Fri Oct 24 2008 (Randal Schwartz)
Posting Guidelines for comp.lang.perl.misc ($Revision: tadmc@seesig.invalid
Re: Unix, Perl, IE, and Excel <cwilbur@chromatico.net>
Re: Unix, Perl, IE, and Excel <jurgenex@hotmail.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 24 Oct 2008 10:10:30 +0200
From: Larry <dontmewithme@got.it>
Subject: Re: can LWP handle this?
Message-Id: <dontmewithme-2B17E7.10103024102008@news.tin.it>
In article <dontmewithme-B3DA8D.18204122102008@news.tin.it>,
Larry <dontmewithme@got.it> wrote:
> if $_hsent == 0
> {
> return "Hello World!";
> $_hsent = 1;
i should have swappeed them:
$_hsent = 1;
return "Hello World!";
------------------------------
Date: Thu, 23 Oct 2008 18:50:49 -0700
From: Jim Gibson <jimsgibson@gmail.com>
Subject: Re: Comparison of two files..
Message-Id: <231020081850490069%jimsgibson@gmail.com>
In article
<f9bc7a7e-e609-440e-aaa6-ed7e9f41a5a5@c22g2000prc.googlegroups.com>,
<clearguy02@yahoo.com> wrote:
> Hi folks,
>
> I have two files:
> a.txt has 100 unique log_id's (one id per line);
> all.txt has 5000 entries (each line has six entries seperated by a
> tab and the first entry on each line is the login ID and then full
> name, country etc).
>
> Now I want to match both files and get the output with all 100 full
> entries and ignore the rest.
>
> Here is the code I am working on.. for some reason, I see more 160
> entries instead of the exact 100 entries.
What does "I see more 160 entries ..." mean? Do you mean you see more
than 160 lines output to required.txt when you only expected 100? What
constitutes the excess lines? Are there duplicates in required.txt? Are
there lines in required.txt that do not have corresponding entries in
a.txt?
>
> ++++++++++++++++++++
> my %myconfig = (
> input1 => 'a.txt',
> input2 => 'all.txt',
> matching => 'required.txt',
> non_matching => 'ignore.txt',
> );
>
> my %fields2;
> {
> open my $input, '<', $myconfig{input1} or die "Cannot open
> '$myconfig{input1}': $!";
> while ( <$input> )
> {
> if ( /^(\w+)/ )
> {
> $fields2{ $1 } = 1;
> }
> }
> close $input or die "Cannot close '$myconfig{input1}': $!";
> }
> open my $input, '<', $myconfig{input2} or die "Cannot open
> '$myconfig{input2}': $!";
> open my $matching, '>', $myconfig{matching} or die "Cannot open
> '$myconfig{matching}': $!";
> open my $non_matching, '>', $myconfig{non_matching} or die "Cannot
> open '$myconfig{non_matching}': $!";
>
> while ( <$input> )
> {
> if ( /^(\w+)/ )
> {
> if ( exists $fields2{ $1 } )
> {
> print $matching "$_\n";
> }
> else
> {
> print $non_matching "$_\n";
> }
> }
> }
>
> ++++++++++++++++++++++++++++++++++++
>
> What I am doing wrong here? Or is there any alternative way of doing
> it?
There doesn't appear to be anything wrong with your code (nothing
obvious anyway). While there are certainly alternate ways of doing
this, you seem to have stumbled upon a good solution that uses a hash.
Without seeing your exact input and output data, it is difficult to do
any further analysis of your problem.
If you can answer the questions above, it might help. If you can
isolate the problem to a few anomalous test cases, you can post those.
--
Jim Gibson
------------------------------
Date: Thu, 23 Oct 2008 22:07:43 -0700
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: Comparison of two files..
Message-Id: <rsl2g45n2a6c7qlouk4m6cmk06slg2f9dm@4ax.com>
clearguy02@yahoo.com wrote:
>Now I want to match both files and get the output with all 100 full
>entries and ignore the rest.
>
>Here is the code I am working on.. for some reason, I see more 160
>entries instead of the exact 100 entries.
[...]
>What I am doing wrong here? Or is there any alternative way of doing
>it?
Your code logic looks alright to me and I can't spot any glaring issues
with it.
Did you consider, that some IDs might appear more than once in the
second file? If you got duplicates that would explain the mismatch.
jue
------------------------------
Date: Fri, 24 Oct 2008 09:03:44 +0300
From: Eric Pozharski <whynot@pozharski.name>
Subject: Re: Filehandle STDIN reopened as $fh1 only for output
Message-Id: <slrngg2pa1.1vm.whynot@orphan.zombinet>
On 2008-10-23, Ilya Zakharevich <nospam-abuse@ilyaz.org> wrote:
*SKIP*
> The 2nd time you open A FILE for writing, OS (again!) chooses the
> first unused handle, so get handle 0 again. This time Perl detects
> that STDIN is opened for write, and decides to warn().
>
> This time Perl heuristic is wrong, and this warning is not relevant.
> You can selectively disable it, as another poster recommends.
What heuristic?
--
Torvalds' goal for Linux is very simple: World Domination
------------------------------
Date: Fri, 24 Oct 2008 12:50:23 +0800
From: Amy Lee <openlinuxsource@gmail.com>
Subject: Help: Nested quantifiers in regex Problem
Message-Id: <pan.2008.10.24.04.50.20.539615@gmail.com>
Hello,
I use qw to make a list with
my @sample = qw/"A..." "A..+" "A.+." "A+.." "A.++" "A+.+" "A++." "A+++"/;
Then there's a list called @ar and I want check whether the element at
@sample belongs to @ar. So I wrote the following codes
foreach my $item_sample (@sample)
{
unless (grep /$item_sample/, @ar) #line 38
{
push @ar, "$item_sample";
}
}
But wehn I run my script it shows following error messages
Nested quantifiers in regex; marked by <-- HERE in m/"A.++ <-- HERE "/ at ./x.pl line 38, <> line 44.
So I really feel very confused about it. Could you tell me why it happens
and how can I fix that?
Thank you very much.
Amy
------------------------------
Date: Thu, 23 Oct 2008 22:22:57 -0700
From: "John W. Krahn" <someone@example.com>
Subject: Re: Help: Nested quantifiers in regex Problem
Message-Id: <QYcMk.7859$Zc.1373@newsfe09.iad>
Amy Lee wrote:
>
> I use qw to make a list with
> my @sample = qw/"A..." "A..+" "A.+." "A+.." "A.++" "A+.+" "A++." "A+++"/;
> Then there's a list called @ar and I want check whether the element at
> @sample belongs to @ar. So I wrote the following codes
> foreach my $item_sample (@sample)
> {
> unless (grep /$item_sample/, @ar) #line 38
> {
> push @ar, "$item_sample";
> }
> }
> But wehn I run my script it shows following error messages
> Nested quantifiers in regex; marked by <-- HERE in m/"A.++ <-- HERE "/ at ./x.pl line 38, <> line 44.
>
> So I really feel very confused about it. Could you tell me why it happens
> and how can I fix that?
In a regular expression . matches any character except newline and .+
means to match any character one or more times. Trying to use .++ makes
no sense as you can't modify a modifier with +, only with ? so .+? would
be valid.
John
--
Perl isn't a toolbox, but a small machine shop where you
can special-order certain sorts of tools at low cost and
in short order. -- Larry Wall
------------------------------
Date: Fri, 24 Oct 2008 17:51:14 +1100
From: Martien Verbruggen <mgjv@heliotrope.com.au>
Subject: Re: Help: Nested quantifiers in regex Problem
Message-Id: <slrngg2s32.nm4.mgjv@mgjv.heliotrope.home>
On Fri, 24 Oct 2008 12:50:23 +0800,
Amy Lee <openlinuxsource@gmail.com> wrote:
> Hello,
>
> I use qw to make a list with
> my @sample = qw/"A..." "A..+" "A.+." "A+.." "A.++" "A+.+" "A++." "A+++"/;
> Then there's a list called @ar and I want check whether the element at
> @sample belongs to @ar. So I wrote the following codes
> foreach my $item_sample (@sample)
> {
> unless (grep /$item_sample/, @ar) #line 38
> {
> push @ar, "$item_sample";
> }
> }
> But wehn I run my script it shows following error messages
> Nested quantifiers in regex; marked by <-- HERE in m/"A.++ <-- HERE "/
> at ./x.pl line 38, <> line 44.
>
> So I really feel very confused about it. Could you tell me why it happens
> and how can I fix that?
In the above $item_sample is being treated as a regular expression. A
few of the things in @sample are simply not valid regular expressions. I
am assuming that you actually didn't mean them to be regular
expressions and that you wanted to check for string equality.
Also, are you aware that the strings you're looking at have double
quotes in them as well? Did you mean them to have those quotes in them?
There are a few ways in which you can fix this.
The minimal change is to correctly quote any metacharacters in the
regular expression (see the perlre documentation)
Change one line (your line 38):
unless (grep /\Q$item_sample/, @ar) #line 38
This does, however, probably not the right thing. It checks whether
$item_sample is PART of one of the elements of @ar. If you had "A+++"
and "A++" in that order in @sample, the second element would not end up
in @ar. I doubt that that was intentional.
You could anchor the regex at the start and end, but it would probably
be better to simply say what (I think) you mean, and test for equality:
unless (grep {$_ eq $item_sample} @ar) #line 38
This still is rather inefficient, because you have to loop through the
whole of @ar for every element of @sample. For small arrays that makes
no difference, but for larger arrays that is a problem.
I think that what you're trying to do is to assign the unique elements
of @sample to @ar, right? The canonical way to do that in Perl is by
using a hash:
my %seen;
my @ar = grep { ! $seen{$_}++ } @sample;
(Note that grep is used here only ones. These two lines are meant to
replace all the code you quoted above, not just line 38.)
Also check out the perlFAQ entry in perlfaq4 with the title "How can I
remove duplicate elements from a list or array?" This entry also
descibes this method with an explicit loop, instead of grep, which you
might find easier.
Martien
--
|
Martien Verbruggen | Quick! Hire a teenager while they still know
| everything.
|
------------------------------
Date: Fri, 24 Oct 2008 04:42:23 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Fri Oct 24 2008
Message-Id: <K987qn.22Kp@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.
AFS-2.4.1
http://search.cpan.org/~nog/AFS-2.4.1/
Basic functions and variables of the AFS module
----
AI-ParticleSwarmOptimization-1.003
http://search.cpan.org/~grandpa/AI-ParticleSwarmOptimization-1.003/
Particle Swarm Optimization (object oriented)
----
Acme-MetaSyntactic-soviet-0.01
http://search.cpan.org/~jforget/Acme-MetaSyntactic-soviet-0.01/
NATO codenames for Soviet-designed equipment
----
Algorithm-Diff-XS-0.02
http://search.cpan.org/~audreyt/Algorithm-Diff-XS-0.02/
Algorithm::Diff with XS core loop
----
Algorithm-Diff-XS-0.03
http://search.cpan.org/~audreyt/Algorithm-Diff-XS-0.03/
Algorithm::Diff with XS core loop
----
Apache2-ASP-2.00_07
http://search.cpan.org/~johnd/Apache2-ASP-2.00_07/
ASP for Perl, reloaded.
----
Apache2-ASP-2.00_08
http://search.cpan.org/~johnd/Apache2-ASP-2.00_08/
ASP for Perl, reloaded.
----
App-Test-Tapat-0.03_1
http://search.cpan.org/~jeremiah/App-Test-Tapat-0.03_1/
An automated testing framework
----
App-Test-Tapat-0.04
http://search.cpan.org/~jeremiah/App-Test-Tapat-0.04/
An automated testing framework
----
Array-Diff-0.05
http://search.cpan.org/~typester/Array-Diff-0.05/
Diff two arrays
----
Business-DPD-0.11
http://search.cpan.org/~domm/Business-DPD-0.11/
handle DPD lable generation
----
CGI-Application-Plugin-RunmodeDeclare-0.03_01
http://search.cpan.org/~rhesa/CGI-Application-Plugin-RunmodeDeclare-0.03_01/
Declare runmodes with keywords
----
CGI-Application-Plugin-ValidateRM-2.3
http://search.cpan.org/~markstos/CGI-Application-Plugin-ValidateRM-2.3/
Help validate CGI::Application run modes using Data::FormValidator
----
CGI-Lazy-0.12
http://search.cpan.org/~vayde/CGI-Lazy-0.12/
----
CGI-Lazy-ModPerl-0.04
http://search.cpan.org/~vayde/CGI-Lazy-ModPerl-0.04/
----
CGI-Session-4.37
http://search.cpan.org/~markstos/CGI-Session-4.37/
persistent session data in CGI applications
----
CPAN-Uploader-0.004
http://search.cpan.org/~rjbs/CPAN-Uploader-0.004/
upload things to the CPAN
----
Config-Simple-Extended-0.08
http://search.cpan.org/~hesco/Config-Simple-Extended-0.08/
Extend Config::Simple w/ Configuration Inheritance, chosen by URL
----
Data-Format-HTML-0.3
http://search.cpan.org/~damog/Data-Format-HTML-0.3/
Format Perl data structures into simple HTML
----
Gnaw-0.09
http://search.cpan.org/~gslondon/Gnaw-0.09/
Define parse grammars using perl subroutine calls. No intermediate grammar languages.
----
Google-ProtocolBuffers-0.08
http://search.cpan.org/~gariev/Google-ProtocolBuffers-0.08/
simple interface to Google Protocol Buffers
----
HTML-FormWidgets-0.2.106
http://search.cpan.org/~pjfl/HTML-FormWidgets-0.2.106/
Create HTML form markup
----
HTML-Tabulate-0.31
http://search.cpan.org/~gavinc/HTML-Tabulate-0.31/
HTML table rendering class
----
HTTP-Session-0.01_05
http://search.cpan.org/~tokuhirom/HTTP-Session-0.01_05/
simple session
----
Javascript-MD5-1.07
http://search.cpan.org/~rsavage/Javascript-MD5-1.07/
Calculate the MD5 digest of a CGI form field
----
Javascript-SHA1-1.04
http://search.cpan.org/~rsavage/Javascript-SHA1-1.04/
Calculate the SHA1 digest of a CGI form field
----
LEOCHARRE-Test-1.09
http://search.cpan.org/~leocharre/LEOCHARRE-Test-1.09/
personal testing subs
----
Macro-Micro-0.052
http://search.cpan.org/~rjbs/Macro-Micro-0.052/
really simple templating for really simple templates
----
Method-Signatures-Simple-0.01_01
http://search.cpan.org/~rhesa/Method-Signatures-Simple-0.01_01/
Basic method declarations with signatures, without source filters
----
Module-ScanDeps-0.86
http://search.cpan.org/~smueller/Module-ScanDeps-0.86/
Recursively scan Perl code for dependencies
----
Moose-Autobox-0.09
http://search.cpan.org/~rjbs/Moose-Autobox-0.09/
Autoboxed wrappers for Native Perl datatypes
----
MooseX-DOM-0.00999_01
http://search.cpan.org/~dmaki/MooseX-DOM-0.00999_01/
Easily Create DOM Based Objects
----
MooseX-LogDispatch-1.2000
http://search.cpan.org/~jgoulah/MooseX-LogDispatch-1.2000/
A Logging Role for Moose
----
MooseX-Meta-Attribute-Index-0.03
http://search.cpan.org/~ctbrown/MooseX-Meta-Attribute-Index-0.03/
Provides index meta attribute trait
----
MooseX-Meta-Attribute-Lvalue-0.02
http://search.cpan.org/~ctbrown/MooseX-Meta-Attribute-Lvalue-0.02/
Immplements lvalue accessors via meta-attribute trait
----
Net-SIP-0.49_1
http://search.cpan.org/~sullr/Net-SIP-0.49_1/
Framework SIP (Voice Over IP, RFC3261)
----
Object-InsideOut-3.51
http://search.cpan.org/~jdhedden/Object-InsideOut-3.51/
Comprehensive inside-out object support module
----
OreOre-Danjou-HelloWorld-0.01
http://search.cpan.org/~danjou/OreOre-Danjou-HelloWorld-0.01/
Sample perl extension module for your own.
----
PAR-Repository-0.16_02
http://search.cpan.org/~smueller/PAR-Repository-0.16_02/
Create and modify PAR repositories
----
PDL-2.4.3_02
http://search.cpan.org/~chm/PDL-2.4.3_02/
the Perl Data Language
----
POE-Component-Server-AsyncEndpoint-0.10_a
http://search.cpan.org/~aimass/POE-Component-Server-AsyncEndpoint-0.10_a/
SOA Asynchronous Endpoint Server
----
POE-Filter-Finger-0.02
http://search.cpan.org/~bingos/POE-Filter-Finger-0.02/
A POE Filter for creating FINGER servers.
----
Padre-0.11
http://search.cpan.org/~szabgab/Padre-0.11/
Perl Application Development and Refactoring Environment
----
Padre-0.12
http://search.cpan.org/~szabgab/Padre-0.12/
Perl Application Development and Refactoring Environment
----
Padre-Plugin-PerlTidy-0.01
http://search.cpan.org/~bricas/Padre-Plugin-PerlTidy-0.01/
Format perl files using Perl::Tidy
----
Path-Extended-0.01
http://search.cpan.org/~ishigaki/Path-Extended-0.01/
yet another Path class
----
Perl-Dist-CatInABox-0.01
http://search.cpan.org/~adamk/Perl-Dist-CatInABox-0.01/
Catalyst (and supporting modules) on top of Strawberry perl for win32.
----
Perl-Dist-CatInABox-0.02
http://search.cpan.org/~adamk/Perl-Dist-CatInABox-0.02/
Catalyst (and supporting modules) on top of Strawberry perl for win32.
----
Perl-Dist-Chocolate-1.07
http://search.cpan.org/~adamk/Perl-Dist-Chocolate-1.07/
Chocolate Perl for Win32 (EXPERIMENTAL)
----
Perlanet-0.08
http://search.cpan.org/~davecross/Perlanet-0.08/
A program for creating web pages that aggregate web feeds (both RSS and Atom).
----
Postfix-Parse-Mailq-1.001
http://search.cpan.org/~rjbs/Postfix-Parse-Mailq-1.001/
parse the output of the postfix mailq command
----
Rcs-Parser-0.03
http://search.cpan.org/~bennie/Rcs-Parser-0.03/
Parse and analyze RCS files.
----
SVN-Look-0.12.442
http://search.cpan.org/~gnustavo/SVN-Look-0.12.442/
A caching wrapper aroung the svnlook command.
----
SelfLoader-1.17
http://search.cpan.org/~smueller/SelfLoader-1.17/
load functions only on demand
----
Spreadsheet-ParseExcel-0.40
http://search.cpan.org/~jmcnamara/Spreadsheet-ParseExcel-0.40/
Get information from Excel file
----
Spreadsheet-ParseExcel-0.41
http://search.cpan.org/~jmcnamara/Spreadsheet-ParseExcel-0.41/
Get information from Excel file
----
Sub-Exporter-0.981
http://search.cpan.org/~rjbs/Sub-Exporter-0.981/
a sophisticated exporter for custom-built routines
----
TRD-DebugLog-0.0.8
http://search.cpan.org/~ichi/TRD-DebugLog-0.0.8/
debug log
----
Task-CatInABox-0.01
http://search.cpan.org/~adamk/Task-CatInABox-0.01/
Catalyst and related modules for exploring Catalyst
----
Test-Simple-0.85_01
http://search.cpan.org/~mschwern/Test-Simple-0.85_01/
Basic utilities for writing tests.
----
Text-Markdown-1.0.22
http://search.cpan.org/~bobtfish/Text-Markdown-1.0.22/
Convert Markdown syntax to (X)HTML
----
Time-Local-Extended-0.51
http://search.cpan.org/~bobo/Time-Local-Extended-0.51/
Increase the range of localtime and timelocal
----
Tk-MK-0.13
http://search.cpan.org/~mikra/Tk-MK-0.13/
----
WWW-LimerickDB-0.0305
http://search.cpan.org/~zoffix/WWW-LimerickDB-0.0305/
interface to fetch limericks from http://limerickdb.com/
----
WWW-VieDeMerde-0.012
http://search.cpan.org/~iderrick/WWW-VieDeMerde-0.012/
A perl module to use the viedemerde.fr API
----
WebService-Livedoor-SpamChampuru-DNSBL-0.01
http://search.cpan.org/~kyanny/WebService-Livedoor-SpamChampuru-DNSBL-0.01/
Perl interface of SpamChampuru DNSBL WebService
----
WebService-iThenticate-0.1
http://search.cpan.org/~phred/WebService-iThenticate-0.1/
----
XML-Feed-0.23
http://search.cpan.org/~simonw/XML-Feed-0.23/
Syndication feed parser and auto-discovery
----
XML-TinyXML-0.05
http://search.cpan.org/~xant/XML-TinyXML-0.05/
Little and efficient Perl module to manage xml data.
----
Xacobeo-0.01_01
http://search.cpan.org/~potyl/Xacobeo-0.01_01/
XPath (XML Path Language) visualizer.
----
lib-0.60
http://search.cpan.org/~smueller/lib-0.60/
manipulate @INC at compile time
----
maybe-0.0101
http://search.cpan.org/~dexter/maybe-0.0101/
Use a Perl module and ignore error if can't be loaded
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.
This message was generated by a Perl program described in my Linux
Magazine column, which can be found on-line (along with more than
200 other freely available past column articles) at
http://www.stonehenge.com/merlyn/LinuxMag/col82.html
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/>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion
------------------------------
Date: Fri, 24 Oct 2008 07:20:04 GMT
From: tadmc@seesig.invalid
Subject: Posting Guidelines for comp.lang.perl.misc ($Revision: 1.8 $)
Message-Id: <EGeMk.4489$ZP4.3386@nlpi067.nbdc.sbc.com>
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.8 $)
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.rehabitation.com/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 and many others on the comp.lang.perl.misc newsgroup.
--
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"
------------------------------
Date: Fri, 24 Oct 2008 00:47:04 -0400
From: Charlton Wilbur <cwilbur@chromatico.net>
Subject: Re: Unix, Perl, IE, and Excel
Message-Id: <86zlkuppkn.fsf@mithril.chromatico.net>
>>>>> "cc" == cartercc <cartercc@gmail.com> writes:
>> Here's an even better question. What does this have to do with Perl?
cc> I'm using Perl as the programming language to build the app.
So? The answer to the question -- which is really about what format
MSIE expects to receive when it displays an Excel file in the browser
window -- would be no different if you were using Ruby, or Python, or
PHP to produce the output. This makes it ipso facto not a Perl
question.
Charlton
--
Charlton Wilbur
cwilbur@chromatico.net
------------------------------
Date: Thu, 23 Oct 2008 22:14:55 -0700
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: Unix, Perl, IE, and Excel
Message-Id: <g3m2g4l3jh0ip2lskp37m7tjt8vi5ti7qm@4ax.com>
cartercc <cartercc@gmail.com> wrote:
>On Oct 23, 6:13 pm, "J. Gleixner" <glex_no-s...@qwest-spam-no.invalid>
>wrote:
>
>> Here's an even better question. What does this have to do with Perl?
>
>I'm using Perl as the programming language to build the app.
And I am using Perl scripts to manage my flight logs. That doesn't make
questions about aviation on topic in this NG.
You tell us what output you expect the Perl script to generate and
chances are very high someone will tell you how to do it.
You don't know what output you want in the first place, then ask in a
group that can tell you what kind of output you want, because _THAT_
answer doesn't change with your choice of programming langauge.
>CSVs. I was thinking that I could construct a file with Perl in a
>format that could be downloaded via an http request that the browser
>would recognize and open in the appropriate application, like MIDI,
>MP3, swf, and so on. Does this have nothing to do with Perl?
Question about how to generate a XYZ-format output: yes.
Question about what format do I need: no.
jue
------------------------------
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 V11 Issue 1943
***************************************