[30269] in Perl-Users-Digest
Perl-Users Digest, Issue: 1512 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue May 6 03:09:41 2008
Date: Tue, 6 May 2008 00:09:08 -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, 6 May 2008 Volume: 11 Number: 1512
Today's topics:
Identification of which line causing regex problem <ela@yantai.org>
Re: Identification of which line causing regex problem <benkasminbullock@gmail.com>
Re: maximum hash/array keys/values xhoster@gmail.com
Re: maximum hash/array keys/values <nospam-abuse@ilyaz.org>
new CPAN modules on Tue May 6 2008 (Randal Schwartz)
perl GD Image resolution problem <zhilianghu@gmail.com>
Re: perl GD Image resolution problem xhoster@gmail.com
Posting Guidelines for comp.lang.perl.misc ($Revision: tadmc@seesig.invalid
Process to fix a broken CPAN module? google@obmac.org
Re: Some sort of scoping problem <benkasminbullock@gmail.com>
Re: Some sort of scoping problem xhoster@gmail.com
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 6 May 2008 09:44:32 +0800
From: "Ela" <ela@yantai.org>
Subject: Identification of which line causing regex problem
Message-Id: <fvod63$sjj$1@ijustice.itsc.cuhk.edu.hk>
Dear all,
I'm modifying a system (totally more than 100000-lines for tens of files)
written by others and would like to identify which line leads to the
following problem.
Invalid [] range "l-c" in regex; marked by <-- HERE in m/^3-oxoacyl-[acyl-c
<-- HERE arrier protein] reductase fabg1$/
Unfortunately the error message does not tell me which line of which file
leads to the problem. Could anybody advise?
------------------------------
Date: Tue, 6 May 2008 02:07:56 +0000 (UTC)
From: Ben Bullock <benkasminbullock@gmail.com>
Subject: Re: Identification of which line causing regex problem
Message-Id: <fvoehs$no8$4@ml.accsnet.ne.jp>
On Tue, 06 May 2008 09:44:32 +0800, Ela wrote:
> I'm modifying a system (totally more than 100000-lines for tens of
> files) written by others and would like to identify which line leads to
> the following problem.
>
> Invalid [] range "l-c" in regex; marked by <-- HERE in
> m/^3-oxoacyl-[acyl-c <-- HERE arrier protein] reductase fabg1$/
>
> Unfortunately the error message does not tell me which line of which
> file leads to the problem. Could anybody advise?
Just grep for oxoacyl?
In Perl you can do it like this:
cat *.pl | perl -n -e 'print "$.:$_" if /oxoacyl/;'
But are you sure there are no line numbers?
#!/usr/local/bin/perl
print if /[z-a]/;
Invalid [] range "z-a" in regex; marked by <-- HERE in m/[z-a <-- HERE ]/
at ./usenet-2008-5-6-c.pl line 2.
I got the line number at the end there.
------------------------------
Date: 06 May 2008 03:22:05 GMT
From: xhoster@gmail.com
Subject: Re: maximum hash/array keys/values
Message-Id: <20080505232209.204$Hk@newsreader.com>
Slickuser <slick.users@gmail.com> wrote:
> What's the maximum hash/array in Perl can hold for keys and values?
The maximum will depend on arcane details of your perl build. Almost
certainly your machine will run out of memory long, long before you reach
the internal limit, unless you are doing rather silly. Like this:
perl -le '$x[2**31-2]=8;'
It succeeded, but took 16 gig. 2**31-1 runs out of memory. 2**31 gives an
error of Modification of non-creatable array value attempted, subscript
-2147483648 at -e line 1.
Apparently even 64-bit builds use 32-bit ints for array indices.
Xho
--
-------------------- http://NewsReader.Com/ --------------------
The costs of publication of this article were defrayed in part by the
payment of page charges. This article must therefore be hereby marked
advertisement in accordance with 18 U.S.C. Section 1734 solely to indicate
this fact.
------------------------------
Date: Tue, 6 May 2008 05:25:00 +0000 (UTC)
From: Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: maximum hash/array keys/values
Message-Id: <fvoq3c$5q0$1@agate.berkeley.edu>
[A complimentary Cc of this posting was sent to
<xhoster@gmail.com>], who wrote in article <20080505232209.204$Hk@newsreader.com>:
> Slickuser <slick.users@gmail.com> wrote:
> > What's the maximum hash/array in Perl can hold for keys and values?
>
> The maximum will depend on arcane details of your perl build. Almost
> certainly your machine will run out of memory long, long before you reach
> the internal limit, unless you are doing rather silly. Like this:
>
> perl -le '$x[2**31-2]=8;'
>
> It succeeded, but took 16 gig. 2**31-1 runs out of memory. 2**31 gives an
> error of Modification of non-creatable array value attempted, subscript
> -2147483648 at -e line 1.
>
> Apparently even 64-bit builds use 32-bit ints for array indices.
Maybe. Also, it looks like the code to convert the size of array to
the size of the buffer-with-pointers-to-scalars defaults to 32-bit
integers for some intermediate values.
Could you report it to p5p as a bug?
Thanks,
Ilya
------------------------------
Date: Tue, 6 May 2008 04:42:18 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Tue May 6 2008
Message-Id: <K0FJqI.B02@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.
Absrtact-Meta-Class-0.02
http://search.cpan.org/~adrianwit/Absrtact-Meta-Class-0.02/
----
Apache-Dir-0.05
http://search.cpan.org/~dwheeler/Apache-Dir-0.05/
Simple Perl Version of mod_dir
----
Apache2-Filter-Minifier-CSS-1.04
http://search.cpan.org/~gtermars/Apache2-Filter-Minifier-CSS-1.04/
CSS minifying output filter
----
Apache2-Filter-Minifier-JavaScript-1.04
http://search.cpan.org/~gtermars/Apache2-Filter-Minifier-JavaScript-1.04/
JS minifying output filter
----
App-Info-0.53
http://search.cpan.org/~dwheeler/App-Info-0.53/
Information about software packages on a system
----
Astro-QDP-Parse-0.11
http://search.cpan.org/~djerius/Astro-QDP-Parse-0.11/
extract Data from a QDP input file
----
Bundle-Theory-1.06
http://search.cpan.org/~dwheeler/Bundle-Theory-1.06/
A bundle to install all of Theory's favorite modules
----
Business-PayPal-API-0.61
http://search.cpan.org/~scottw/Business-PayPal-API-0.61/
PayPal API
----
CAD-Calc-0.27
http://search.cpan.org/~ewilhelm/CAD-Calc-0.27/
generic cad-related geometry calculations
----
CPAN-Mini-Extract-1.18
http://search.cpan.org/~adamk/CPAN-Mini-Extract-1.18/
Create CPAN::Mini mirrors with the archives extracted
----
CPAN-Mini-Extract-1.19
http://search.cpan.org/~adamk/CPAN-Mini-Extract-1.19/
Create CPAN::Mini mirrors with the archives extracted
----
CSS-Minifier-XS-0.01
http://search.cpan.org/~gtermars/CSS-Minifier-XS-0.01/
XS based CSS minifier
----
Catalyst-Plugin-Session-Store-Jifty-DBI-0.01
http://search.cpan.org/~ishigaki/Catalyst-Plugin-Session-Store-Jifty-DBI-0.01/
Store your session with Jifty::DBI
----
Class-Delegator-0.07
http://search.cpan.org/~dwheeler/Class-Delegator-0.07/
Simple and fast object-oriented delegation
----
Class-Meta-0.55
http://search.cpan.org/~dwheeler/Class-Meta-0.55/
Class automation, introspection, and data validation
----
Class-Std-Fast-v0.0.6
http://search.cpan.org/~acid/Class-Std-Fast-v0.0.6/
faster but less secure than Class::Std
----
Compress-Raw-Bzip2-2.010
http://search.cpan.org/~pmqs/Compress-Raw-Bzip2-2.010/
Low-Level Interface to bzip2 compression library
----
Compress-Raw-Zlib-2.010
http://search.cpan.org/~pmqs/Compress-Raw-Zlib-2.010/
Low-Level Interface to zlib compression library
----
Compress-Zlib-2.010
http://search.cpan.org/~pmqs/Compress-Zlib-2.010/
Interface to zlib compression library
----
Curses-UI-Grid-0.14
http://search.cpan.org/~adrianwit/Curses-UI-Grid-0.14/
Create and manipulate data in grid model
----
DBIx-Connection-0.01
http://search.cpan.org/~adrianwit/DBIx-Connection-0.01/
Simple database interface.
----
DBIx-Connection-0.02
http://search.cpan.org/~adrianwit/DBIx-Connection-0.02/
Simple database interface.
----
Data-NDS-1.01
http://search.cpan.org/~sbeck/Data-NDS-1.01/
routines to work with a perl nested data structure
----
Data-Types-0.08
http://search.cpan.org/~dwheeler/Data-Types-0.08/
Validate and convert data types.
----
DataExtract-FixedWidth-0.02
http://search.cpan.org/~ecarroll/DataExtract-FixedWidth-0.02/
The one stop shop for parsing static column width text tables!
----
Date-Manip-5.50
http://search.cpan.org/~sbeck/Date-Manip-5.50/
date manipulation routines
----
Deliantra-Client-0.9971
http://search.cpan.org/~mlehmann/Deliantra-Client-0.9971/
----
Devel-CoverX-Covered-0.006
http://search.cpan.org/~johanl/Devel-CoverX-Covered-0.006/
Collect and report caller (test file) and covered (source file) statistics from the cover_db
----
Emacs-PDE-v0.2.14
http://search.cpan.org/~yewenbin/Emacs-PDE-v0.2.14/
Perl Development Environment in emacs
----
Exception-Class-DBI-0.97
http://search.cpan.org/~dwheeler/Exception-Class-DBI-0.97/
DBI Exception objects
----
Geo-Google-PolylineEncoder-0.04
http://search.cpan.org/~spurkis/Geo-Google-PolylineEncoder-0.04/
encode lat/lons to Google Maps Polylines
----
Geo-IP-1.33
http://search.cpan.org/~borisz/Geo-IP-1.33/
Look up location and network information by IP Address
----
HTML-Split-0.01
http://search.cpan.org/~ziguzagu/HTML-Split-0.01/
Splitting HTML by number of characters.
----
HTML-Widget-Factory-0.066
http://search.cpan.org/~rjbs/HTML-Widget-Factory-0.066/
churn out HTML widgets
----
IO-Compress-Base-2.010
http://search.cpan.org/~pmqs/IO-Compress-Base-2.010/
Base Class for IO::Compress modules
----
IO-Compress-Bzip2-2.010
http://search.cpan.org/~pmqs/IO-Compress-Bzip2-2.010/
Write bzip2 files/buffers
----
IO-Compress-Lzf-2.010
http://search.cpan.org/~pmqs/IO-Compress-Lzf-2.010/
Write lzf files/buffers
----
IO-Compress-Lzop-2.010
http://search.cpan.org/~pmqs/IO-Compress-Lzop-2.010/
Write lzop files/buffers
----
IO-Compress-Zlib-2.010
http://search.cpan.org/~pmqs/IO-Compress-Zlib-2.010/
----
JavaScript-Minifier-XS-0.01
http://search.cpan.org/~gtermars/JavaScript-Minifier-XS-0.01/
XS based JavaScript minifier
----
List-Parseable-1.02
http://search.cpan.org/~sbeck/List-Parseable-1.02/
routines to work with lists containing a simple language
----
MasonX-Resolver-Multiplex-0.001
http://search.cpan.org/~hdp/MasonX-Resolver-Multiplex-0.001/
multiplex several Resolver objects
----
Math-SigFigs-1.06
http://search.cpan.org/~sbeck/Math-SigFigs-1.06/
do math with correct handling of significant figures
----
Module-Manifest-0.03
http://search.cpan.org/~adamk/Module-Manifest-0.03/
Parse and examine a Perl distribution MANIFEST file
----
Number-Ops-1.01
http://search.cpan.org/~sbeck/Number-Ops-1.01/
Simple operations on numbers.
----
POE-Filter-IASLog-1.04
http://search.cpan.org/~bingos/POE-Filter-IASLog-1.04/
A POE Filter for Microsoft IAS-formatted log entries.
----
Parse-BBCode-0.03
http://search.cpan.org/~tinita/Parse-BBCode-0.03/
Module to turn BBCode into HTML or plain text
----
Parse-IASLog-1.06
http://search.cpan.org/~bingos/Parse-IASLog-1.06/
A parser for Microsoft IAS-formatted log entries.
----
Parse-IRC-1.12
http://search.cpan.org/~bingos/Parse-IRC-1.12/
A parser for the IRC protocol.
----
Parse-Marpa-0.211_005
http://search.cpan.org/~jkegl/Parse-Marpa-0.211_005/
Earley's algorithm with LR(0) precomputation
----
RT-Extension-SLA-0.02
http://search.cpan.org/~ruz/RT-Extension-SLA-0.02/
Service Level Agreements for RT
----
RT-Extension-SearchResults-XLS-0.02
http://search.cpan.org/~elacour/RT-Extension-SearchResults-XLS-0.02/
Add Excel format export to RT search results
----
SOAP-Lite-0.710.05
http://search.cpan.org/~mkutter/SOAP-Lite-0.710.05/
Perl's Web Services Toolkit
----
SVN-Notify-Filter-Watchers-0.06
http://search.cpan.org/~larrysh/SVN-Notify-Filter-Watchers-0.06/
Subscribe to SVN::Notify commits with a Subversion property.
----
Set-Files-1.02
http://search.cpan.org/~sbeck/Set-Files-1.02/
routines to work with files, each definining a single set
----
Simple-SAX-Serializer-0.01
http://search.cpan.org/~adrianwit/Simple-SAX-Serializer-0.01/
----
Sort-DataTypes-2.01
http://search.cpan.org/~sbeck/Sort-DataTypes-2.01/
Sort a list of data using methods relevant to the type of data
----
Template-Plugin-Lingua-Conjunction-0.02
http://search.cpan.org/~brentdax/Template-Plugin-Lingua-Conjunction-0.02/
Template Toolkit plugin for human-readable lists
----
Template-Plugin-ListOps-1.02
http://search.cpan.org/~sbeck/Template-Plugin-ListOps-1.02/
Plugin interface to list operations
----
Term-TUI-1.21
http://search.cpan.org/~sbeck/Term-TUI-1.21/
simple tool for building text-based user interfaces
----
Test-CheckChanges-0.05
http://search.cpan.org/~gam/Test-CheckChanges-0.05/
Check that the Changes file matches the distribution.
----
Test-DBUnit-0.01
http://search.cpan.org/~adrianwit/Test-DBUnit-0.01/
----
Text-WordDiff-0.03
http://search.cpan.org/~dwheeler/Text-WordDiff-0.03/
Track changes between documents
----
Time-Piece-ISO-0.11
http://search.cpan.org/~dwheeler/Time-Piece-ISO-0.11/
ISO 8601 Subclass of Time::Piece
----
Twitter-Badge-0.01
http://search.cpan.org/~arul/Twitter-Badge-0.01/
Perl module that displays the current Twitter information of a user
----
Unix-SavedIDs-v0.1
http://search.cpan.org/~dmartin/Unix-SavedIDs-v0.1/
interface to unix saved id commands: getresuid(), getresgid(), setresuid() and setresgid()
----
Unix-SavedIDs-v0.2
http://search.cpan.org/~dmartin/Unix-SavedIDs-v0.2/
interface to unix saved id commands: getresuid(), getresgid(), setresuid() and setresgid()
----
WWW-Ohloh-API-0.1.0
http://search.cpan.org/~yanick/WWW-Ohloh-API-0.1.0/
Ohloh API implementation
----
WWW-Search-News-1.077
http://search.cpan.org/~mthurn/WWW-Search-News-1.077/
WWW::Search backend for news searches
----
WWW-Search-Yahoo-China-1.002
http://search.cpan.org/~mthurn/WWW-Search-Yahoo-China-1.002/
WWW::Search backend for searching Yahoo! China
----
Widget-Meta-0.04
http://search.cpan.org/~dwheeler/Widget-Meta-0.04/
Metadata for user interface widgets
----
Win32-SqlServer-2.004
http://search.cpan.org/~sommar/Win32-SqlServer-2.004/
Access SQL Server from Perl via OLE DB
----
YAML-Tiny-1.30
http://search.cpan.org/~adamk/YAML-Tiny-1.30/
Read/Write YAML files with as little code as possible
----
activitymail-1.25
http://search.cpan.org/~dwheeler/activitymail-1.25/
CVS activity notification
----
esjis-0.14
http://search.cpan.org/~ina/esjis-0.14/
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: Mon, 5 May 2008 20:28:15 -0700 (PDT)
From: Zhiliang Hu <zhilianghu@gmail.com>
Subject: perl GD Image resolution problem
Message-Id: <3cfc92d5-013b-4b38-8da9-a38af7f6c9eb@b64g2000hsa.googlegroups.com>
I use GD::Image to create figures. Here is an example:
http://sphinx.vet.unimelb.edu.au/QTLdb/tmp/map490151833.png
For publication purposes we need high resolution pictures. I am
seeking expert advice as how can I improve the resolution?
Thanks in advance!
Zhiliang
------------------------------
Date: 06 May 2008 03:43:41 GMT
From: xhoster@gmail.com
Subject: Re: perl GD Image resolution problem
Message-Id: <20080505234344.919$V1@newsreader.com>
Zhiliang Hu <zhilianghu@gmail.com> wrote:
> I use GD::Image to create figures. Here is an example:
> http://sphinx.vet.unimelb.edu.au/QTLdb/tmp/map490151833.png
>
> For publication purposes we need high resolution pictures. I am
> seeking expert advice as how can I improve the resolution?
Hi Zhiliang,
The resolution of a png is one pixel per pixel. You can't get any higher
than that! You should be able to make the entire image larger, for example
by specifying a larger array when you call new on your GD object.
Currently it is 360x402, you could try doubling each.
Or you may need to switch to something other than png, like svg using
GD::SVG.
Xho
--
-------------------- http://NewsReader.Com/ --------------------
The costs of publication of this article were defrayed in part by the
payment of page charges. This article must therefore be hereby marked
advertisement in accordance with 18 U.S.C. Section 1734 solely to indicate
this fact.
------------------------------
Date: Tue, 06 May 2008 06:10:12 GMT
From: tadmc@seesig.invalid
Subject: Posting Guidelines for comp.lang.perl.misc ($Revision: 1.8 $)
Message-Id: <8DSTj.15889$2g1.14857@nlpi068.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: Mon, 5 May 2008 23:43:07 -0700 (PDT)
From: google@obmac.org
Subject: Process to fix a broken CPAN module?
Message-Id: <2f2ed740-c18d-4099-bcda-1cabc1f25ba7@w1g2000prd.googlegroups.com>
I have found a major flaw in a CPAN package. The package is
File::Binary and it has big endian and little endian unpack-ing
backwards. Likewise, all the test files are reversed so that the
tests all pass!
Why do I believe this is true?
From the perl manual on pack:
n,N unpacks a 16 or 32 bit integer in "network" or big endian order
v,V unpacks a 16 or 32 bit integer in "VAX" or little endian order
From the code:
if ($endian == $BIG_ENDIAN) {
$self->{_ui16} = 'v';
$self->{_ui32} = 'V';
} else {
$self->{_ui16} = 'n';
$self->{_ui32} = 'N';
}
When I 'od -x' the test files, they are clearly reversed:
od -x be.power10.n32.ints
0000000 ffff ffff f6ff ffff 9cff ffff 18fc
ffff
0000020 f0d8 ffff 6079 feff c0bd f0ff 8069
67ff
0000040 001f 0afa 0036 65c4
From the test file ".../File-Binary-1.7/t/17power10.n32.ints.be.t":
is($bin->get_si32(),-1); # 0xffffffff in B.E.
is($bin->get_si32(),-10); # 0xfffffff6 in B.E.
is($bin->get_si32(),-100); # 0xffffff9c in B.E.
is($bin->get_si32(),-1000); # 0xffff18fc in B.E.
so clearly this file contains little-endian integers.
OK, so there is a mistake here -- I would like to submit a fix to all
this -- my question is how do I go about doing this? I have contacted
the author, but no response.
Any help/guidance would be appreciated. When I get this fixed, then
I'll be able to submit my new module to CPAN (my first attempt).
Thanks!
------------------------------
Date: Tue, 6 May 2008 02:08:26 +0000 (UTC)
From: Ben Bullock <benkasminbullock@gmail.com>
Subject: Re: Some sort of scoping problem
Message-Id: <fvoeiq$no8$5@ml.accsnet.ne.jp>
On Mon, 05 May 2008 18:04:09 -0700, Mintcake wrote:
> This is *not* a trivial problem. If you know Perl well, please take a
> bit of time to look at this.
I don't know Perl that well, but in case this needs confirmation, I had a
look & confirmed the following odd behaviour:
> If I include the package Foo code in the main program instead of a
> separate module I get the expected result. If I lose the ini()
> subroutime and put the eval directly in the constructor I get the
> expected result. If I don't declare @xyxxy with my or use our instead I
> get the expected result.
> If I add a use strict in Foo.pm and change $self->ini('xyzzy') to
> $self->ini('plugh') I get the expeted error:
>
> Can't use an undefined value as an ARRAY reference at /home/tony/lib/
> Foo.pm line 11.
>
> I'm using perl v5.8.8 and I get the some on i686-linux and Activstate
> on Windoze.
------------------------------
Date: 06 May 2008 03:32:16 GMT
From: xhoster@gmail.com
Subject: Re: Some sort of scoping problem
Message-Id: <20080505233219.964$dF@newsreader.com>
Mintcake <tony@skelding.co.uk> wrote:
> This is *not* a trivial problem. If you know Perl well, please take a
> bit of time to look at this.
>
> I have the following code in a file Foo.pm
>
> package Foo;
>
> my @xyzzy = (1,2,3);
>
> sub new {
> my $self = bless {}, shift;
> $self->ini('xyzzy');
> print \@xyzzy, ' ', scalar @xyzzy;
> print $self->{xyzzy}, ' ', scalar @{$self->{xyzzy}};
> }
>
> sub ini {
> my ($self, $field) = @_;
> eval "\$self->{$field} = \\\@$field";
> }
ini never latches onto @xyzzy, because @xyzzy is not mentioned
in ini at compile time. Very similar to:
http://groups.google.com/group/comp.lang.perl.misc/browse_frm/thread/eaf48dac9f298e29
Xho
--
-------------------- http://NewsReader.Com/ --------------------
The costs of publication of this article were defrayed in part by the
payment of page charges. This article must therefore be hereby marked
advertisement in accordance with 18 U.S.C. Section 1734 solely to indicate
this fact.
------------------------------
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 1512
***************************************