[30503] in Perl-Users-Digest
Perl-Users Digest, Issue: 1746 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jul 25 06:09:42 2008
Date: Fri, 25 Jul 2008 03:09: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 Fri, 25 Jul 2008 Volume: 11 Number: 1746
Today's topics:
Re: C linked lists in Perl <hjp-usenet2@hjp.at>
Detecting keypress when window isn't in focus <chris.wilkins1@gmail.com>
Re: EPIC and "my" variables <mjcarman@mchsi.com>
Re: FAQ 4.2 Why is int() broken? <hjp-usenet2@hjp.at>
new CPAN modules on Fri Jul 25 2008 (Randal Schwartz)
Re: number of maximum decimal places supported with Per <RedGrittyBrick@SpamWeary.foo>
Re: number of maximum decimal places supported with Per sln@netherlands.com
Re: number of maximum decimal places supported with Per <RedGrittyBrick@SpamWeary.foo>
Re: number of maximum decimal places supported with Per <tadmc@seesig.invalid>
Posting Guidelines for comp.lang.perl.misc ($Revision: tadmc@seesig.invalid
Re: Profiling? <tadmc@seesig.invalid>
Re: Undefined behaviour <hjp-usenet2@hjp.at>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 25 Jul 2008 00:56:27 +0200
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: C linked lists in Perl
Message-Id: <slrng8i251.dfc.hjp-usenet2@hrunkner.hjp.at>
On 2008-07-23 23:05, Joost Diepenmaat <joost@zeekat.nl> wrote:
> "Peter J. Holzer" <hjp-usenet2@hjp.at> writes:
>> On 2008-07-22 18:16, xhoster@gmail.com <xhoster@gmail.com> wrote:
>>> "Peter J. Holzer" <hjp-usenet2@hjp.at> wrote:
>>>> who in his right mind builds datastructures with 100000 nesting
>>>> levels?
>>>
>>> Someone trying to implement a large linked list, for one, or course.
>>
>> However, why would someone do this in Perl? Which problem would be
>> better solved by a singly linked list than an array in Perl? It just
>> seems to be unidiomatic.
>
> It's definitely unidiomatic, but linked lists (especially large linked
> lists) are a conceptually simple way of dealing with certain problems
> that large arrays have (like splicing).
Singly linked lists (and we are only talking about singly linked lists
here, other types of linked lists or mixed list/hash or list/tree
structures don't have the aforementioned GC problem (they have other
problems instead ;-)) allow fast insertion and deletion (on my machine
adding or removing a single element is faster for lists of more than
10000 elements than using splice), but at the cost of very slow or
limited search. There may be a few problems where this doesn't matter,
but in general linked lists are often used for stacks and queues, where
you don't have to search because you only ever access the ends. Both can
be efficiently implemented with Perl arrays (about 5 times faster than
an equivalent linked list for stacks/queues with 100_000 to 1_000_000
elements).
> IMHO having built-in linked lists would be a good thing.
Can't say I ever missed them.
hp
------------------------------
Date: Fri, 25 Jul 2008 00:53:08 -0700 (PDT)
From: Chris Wilkins <chris.wilkins1@gmail.com>
Subject: Detecting keypress when window isn't in focus
Message-Id: <31363ea2-2117-4dfa-b60b-8955a5a9a37a@u36g2000pro.googlegroups.com>
I have a script which loops forever and I need a way to break out of
the loop with a keypress. I can do this with the script below and it
works fine, my problem is that if I take the focus away from the
command window that the script is running in, the keypress isn't
recognised and the loop doesn't end.
#!/usr/bin/perl -l
use strict;
use warnings;
use Win32::GuiTest qw/:ALL/;
use Term::ReadKey;
my $i = 0;
while (1)
{
ReadMode(3);
my $char = ReadKey(-1);
if ($char eq 'q')
{
last;
}
print $i;
sleep 1;
$i++;
}
Is there a way (with Term::ReadKey or anything else) of detecting a
keypress when the script window does not have focus?
------------------------------
Date: Thu, 24 Jul 2008 23:14:30 GMT
From: Michael Carman <mjcarman@mchsi.com>
Subject: Re: EPIC and "my" variables
Message-Id: <q18ik.213601$TT4.185494@attbi_s22>
Steve Rainbird wrote:
> I have installed padWalker but still can't see the "my" variables when I
> debug.
I'm not an Eclipse user, so I can only ask the obvious question: Are the
variables in scope at the time you're trying to evaluate them?
-mjc
------------------------------
Date: Fri, 25 Jul 2008 01:09:52 +0200
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: FAQ 4.2 Why is int() broken?
Message-Id: <slrng8i2u0.dfc.hjp-usenet2@hrunkner.hjp.at>
On 2008-07-24 16:19, szr <szrRE@szromanMO.comVE> wrote:
> Peter J. Holzer wrote:
>> No, floats in perl are normally "double", i.e., 64 bit. But maybe
>> you've built perl long "long double" (80, 96, or 128 bit, depending on
>> platform) support?
>>
>> % perl -V:nvtype -V:nvsize
>> nvtype='double';
>> nvsize='8';
>
> You are right. Built with 64 bit int, but 96 bit float, the size of a
> long double in c:
>
> $ perl5.10.0 -V:nvtype -V:nvsize
> nvtype='long double';
> nvsize='12';
>
> $ perl5.8.8 -V:nvtype -V:nvsize
> nvtype='long double';
> nvsize='12';
>
>> % perl -e 'print int(0.6/0.2-2), qq{\n};'
>> 0
>
> Seems you need the extra precision that building Perl with "long double"
> support
No. The extra precision doesn't help. As I argued below it's just
coincidence that error isn't noticable in this case. if you use other
numbers instead of 0.6 and 0.2, you will discover some where the result
is "wrong" even with 96 bits. Indeed you may find some where the result
is correct for 64 bits and wrong for 96 bits.
hp
------------------------------
Date: Fri, 25 Jul 2008 04:42:20 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Fri Jul 25 2008
Message-Id: <K4Jp2K.17D4@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.
Acme-Acotie-0.01
http://search.cpan.org/~yappo/Acme-Acotie-0.01/
Crash of Namespase
----
Acme-Tiroler-0.04
http://search.cpan.org/~marcel/Acme-Tiroler-0.04/
write code like a tyrolean says it
----
Acme-Tiroler-0.05
http://search.cpan.org/~marcel/Acme-Tiroler-0.05/
write code like a tyrolean says it
----
Algorithm-EquivalenceSets-0.03
http://search.cpan.org/~marcel/Algorithm-EquivalenceSets-0.03/
Group sets transitively
----
AnyEvent-HTTP-1.04
http://search.cpan.org/~mlehmann/AnyEvent-HTTP-1.04/
simple but non-blocking HTTP/HTTPS client
----
Aspect-0.13
http://search.cpan.org/~marcel/Aspect-0.13/
AOP for Perl
----
Aspect-0.14
http://search.cpan.org/~marcel/Aspect-0.14/
AOP for Perl
----
Astro-SIMBAD-Client-0.013
http://search.cpan.org/~wyant/Astro-SIMBAD-Client-0.013/
Fetch astronomical data from SIMBAD 4.
----
Authen-Tcpdmatch-0.05
http://search.cpan.org/~ioannis/Authen-Tcpdmatch-0.05/
Perl extension for parsing hosts.allow and hosts.deny
----
Authen-Tcpdmatch-0.06
http://search.cpan.org/~ioannis/Authen-Tcpdmatch-0.06/
Perl extension for parsing hosts.allow and hosts.deny
----
Authen-Tcpdmatch-0.07
http://search.cpan.org/~ioannis/Authen-Tcpdmatch-0.07/
Perl extension for parsing hosts.allow and hosts.deny
----
CGP-CLI-2.7.5
http://search.cpan.org/~jbuhacoff/CGP-CLI-2.7.5/
----
Catalyst-Plugin-Assets-0.034
http://search.cpan.org/~rkrimen/Catalyst-Plugin-Assets-0.034/
Manage and minify .css and .js assets in a Catalyst application
----
Check-ISA-0.03
http://search.cpan.org/~nuffin/Check-ISA-0.03/
DWIM, correct checking of an object's class
----
Chemistry-ESPT-0.01
http://search.cpan.org/~jsonnenb/Chemistry-ESPT-0.01/
----
Class-DBI-Loader-Kinship-0.02
http://search.cpan.org/~ioannis/Class-DBI-Loader-Kinship-0.02/
Fixes to Class::DBI::Loader
----
Class-DBI-Loader-Kinship-0.03
http://search.cpan.org/~ioannis/Class-DBI-Loader-Kinship-0.03/
Fixes to Class::DBI::Loader
----
Config-Format-Ini-0.07
http://search.cpan.org/~ioannis/Config-Format-Ini-0.07/
Reads INI configuration files
----
Crypt-PBC-0.7.20.1.4.18
http://search.cpan.org/~jettero/Crypt-PBC-0.7.20.1.4.18/
OO interface for the Stanford PBC library
----
DBD-Pg-2.8.7
http://search.cpan.org/~turnstep/DBD-Pg-2.8.7/
PostgreSQL database driver for the DBI module
----
DBIx-Class-0.08099_04
http://search.cpan.org/~lsaunders/DBIx-Class-0.08099_04/
Extensible and flexible object <-> relational mapper.
----
Data-Consumer-0.10
http://search.cpan.org/~yves/Data-Consumer-0.10/
Repeatedly consume a data resource in a robust way
----
Data-Feed-0.00001
http://search.cpan.org/~dmaki/Data-Feed-0.00001/
Extensible Feed Parsing Tool
----
Data-Feed-0.00002
http://search.cpan.org/~dmaki/Data-Feed-0.00002/
Extensible Feed Parsing Tool
----
Data-Rlist-1.43
http://search.cpan.org/~aspindler/Data-Rlist-1.43/
----
Data-UUID-LibUUID-0.01
http://search.cpan.org/~nuffin/Data-UUID-LibUUID-0.01/
uuid.h based UUID generation (versions 1, 2 and 4)
----
Data-UUID-LibUUID-0.02
http://search.cpan.org/~nuffin/Data-UUID-LibUUID-0.02/
uuid.h based UUID generation (versions 1, 2 and 4)
----
Data-Visitor-Encode-0.10001
http://search.cpan.org/~dmaki/Data-Visitor-Encode-0.10001/
Encode/Decode Values In A Structure
----
Devel-NYTProf-2.02
http://search.cpan.org/~timb/Devel-NYTProf-2.02/
Powerful feature-rich perl source code profiler
----
Devel-PartialDump-0.03
http://search.cpan.org/~nuffin/Devel-PartialDump-0.03/
Partial dumping of data structures, optimized for argument printing.
----
Devel-PartialDump-0.04
http://search.cpan.org/~nuffin/Devel-PartialDump-0.04/
Partial dumping of data structures, optimized for argument printing.
----
Devel-PartialDump-0.05
http://search.cpan.org/~nuffin/Devel-PartialDump-0.05/
Partial dumping of data structures, optimized for argument printing.
----
Devel-Sub-Which-0.05
http://search.cpan.org/~nuffin/Devel-Sub-Which-0.05/
Name information about sub calls ? la "can" in UNIVERSAL and <which(1)>.
----
Egg-Release-DBI-0.06
http://search.cpan.org/~lushe/Egg-Release-DBI-0.06/
Package kit of model DBI.
----
File-Assets-0.061
http://search.cpan.org/~rkrimen/File-Assets-0.061/
Manage .css and .js assets in a web application
----
File-Rdiff-1.0
http://search.cpan.org/~mlehmann/File-Rdiff-1.0/
generate remote signatures and patch files using librsync
----
Getopt-Modular-0.03
http://search.cpan.org/~dmcbride/Getopt-Modular-0.03/
Modular access to Getopt::Long
----
Google-Chart-0.05000_01
http://search.cpan.org/~dmaki/Google-Chart-0.05000_01/
Interface to Google Charts API
----
IO-Handle-unread-0.01
http://search.cpan.org/~gfuji/IO-Handle-unread-0.01/
Pushes string back into input filehandle
----
IO-Infiles-0.04
http://search.cpan.org/~ioannis/IO-Infiles-0.04/
Multiple handlers for multiple __END__-like tokens
----
JE-0.022
http://search.cpan.org/~sprout/JE-0.022/
Pure-Perl ECMAScript (JavaScript) Engine
----
Mewsoft-Pagination-0.20
http://search.cpan.org/~mewsoft/Mewsoft-Pagination-0.20/
Standalone Object-Oriented Efficient Data Pagination
----
NBU-0.95
http://search.cpan.org/~dutchman/NBU-0.95/
Main entry point for NetBackup OO Modules
----
Net-Amazon-EC2-0.07
http://search.cpan.org/~jkim/Net-Amazon-EC2-0.07/
Perl interface to the Amazon Elastic Compute Cloud (EC2) environment.
----
Net-ModestMaps-1.1
http://search.cpan.org/~ascope/Net-ModestMaps-1.1/
Simple OOP wrapper for calling ModestMaps web services.
----
Net-SSLeay-1.35
http://search.cpan.org/~flora/Net-SSLeay-1.35/
Perl extension for using OpenSSL
----
POE-Component-AI-MegaHAL-1.16
http://search.cpan.org/~bingos/POE-Component-AI-MegaHAL-1.16/
A non-blocking wrapper around AI::MegaHAL.
----
POE-Component-SmokeBox-Uploads-CPAN-Mini-0.02
http://search.cpan.org/~bingos/POE-Component-SmokeBox-Uploads-CPAN-Mini-0.02/
Obtain uploaded CPAN modules via a CPAN::Mini mirror
----
POSIX-Regex-0.90.14
http://search.cpan.org/~jettero/POSIX-Regex-0.90.14/
OO interface for the gnu regex engine
----
Pg-Loader-0.07
http://search.cpan.org/~ioannis/Pg-Loader-0.07/
Perl extension for loading Postgres tables
----
Pg-Pcurse-0.22
http://search.cpan.org/~ioannis/Pg-Pcurse-0.22/
Monitors a Postgres cluster
----
Rose-DBx-Object-Renderer-0.18
http://search.cpan.org/~danny/Rose-DBx-Object-Renderer-0.18/
Web UI Rendering for Rose::DB::Object
----
Rose-DBx-Object-Renderer-0.19
http://search.cpan.org/~danny/Rose-DBx-Object-Renderer-0.19/
Web UI Rendering for Rose::DB::Object
----
Set-Array-0.16
http://search.cpan.org/~rsavage/Set-Array-0.16/
Arrays as objects with lots of handy methods (including Set comparisons) and support for method chaining.
----
Set-Array-0.17
http://search.cpan.org/~rsavage/Set-Array-0.17/
Arrays as objects with lots of handy methods (including Set comparisons) and support for method chaining.
----
Sub-Curried-0.01
http://search.cpan.org/~osfameron/Sub-Curried-0.01/
Currying of subroutines via a new 'curry' declarator
----
Sub-Curried-0.02
http://search.cpan.org/~osfameron/Sub-Curried-0.02/
Currying of subroutines via a new 'curry' declarator
----
Sub-Delete-0.01
http://search.cpan.org/~sprout/Sub-Delete-0.01/
Perl module enabling one to delete subroutines
----
Text-Markdown-1.0.21
http://search.cpan.org/~bobtfish/Text-Markdown-1.0.21/
Convert Markdown syntax to (X)HTML
----
Tie-Hash-Method-0.01
http://search.cpan.org/~yves/Tie-Hash-Method-0.01/
Tied hash with specific methods overriden by callbacks
----
Tie-Hash-Method-0.02
http://search.cpan.org/~yves/Tie-Hash-Method-0.02/
Tied hash with specific methods overriden by callbacks
----
Video-Capture-V4l-0.902
http://search.cpan.org/~mlehmann/Video-Capture-V4l-0.902/
Perl interface to the Video4linux framegrabber interface.
----
WebService-EveOnline-0.1.0
http://search.cpan.org/~chrisc/WebService-EveOnline-0.1.0/
a wrapper intended to (eventually) provide a consistent interface to the MMORPG game, "Eve Online"
----
WebService-EveOnline-0.5
http://search.cpan.org/~chrisc/WebService-EveOnline-0.5/
a wrapper intended to (eventually) provide a consistent interface to the MMORPG game, "Eve Online"
----
XML-RelaxNG-Compact-PXB-0.09
http://search.cpan.org/~mpg/XML-RelaxNG-Compact-PXB-0.09/
create perl XML (RelaxNG Compact) data binding API
----
constant-private-0.01
http://search.cpan.org/~sprout/constant-private-0.01/
Perl pragma to declare private compile-time constants
----
v6-0.025
http://search.cpan.org/~fglock/v6-0.025/
An experimental Perl 6 implementation
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: Thu, 24 Jul 2008 21:31:30 +0100
From: RedGrittyBrick <RedGrittyBrick@SpamWeary.foo>
Subject: Re: number of maximum decimal places supported with Perl
Message-Id: <TvydnRoWjoI4exXVnZ2dneKdnZydnZ2d@bt.com>
sln@netherlands.com wrote:
> On Thu, 24 Jul 2008 20:26:50 +0100, RedGrittyBrick <RedGrittyBrick@SpamWeary.foo> wrote:
>
>> Jack wrote:
>>> On Jul 22, 4:29 pm, Leon Timmermans <faw...@gmail.com> wrote:
>>>> On Tue, 22 Jul 2008 16:17:15 -0700, Jack wrote:
>>>>> Hi there, does anyone know what data type has the most digits of
>>>>> precision perl, and what the upper bound (maximum) number of decimal
>>>>> places is for that data type ?
>>>>> Thank you,
>>>>> Jack
>>>> I don't think there is a clearly defined maximum, but if you need to rely
>>>> on it Math::BigFloat supports arbitrary precision floating point math.
>>>>
>>>> Leon Timmermans
>>> Great, and thank you, do you happen to know is the maximum number of
>>> digits supported on the left hand (positive) side of the decimal ?
>>>
>> About 308?
>
> 308 digit mantissa. Really?
#!/usr/bin/perl
use strict;
use warnings;
use Math::BigFloat;
my $pi = Math::BigFloat->bpi(308);
print "pi is $pi\n\n";
my $m = Math::BigFloat->new(1E308);
$pi->bmul($m);
print "pi is $pi\n\n";
C:\Users\Ian\Documents>perl big.pl
pi is
3.141592653589793238462643383279502884197169399375105820974944592307816406286208
99862803482534211706798214808651328230664709384460955058223172535940812848111745
02841027019385211055596446229489549303819644288109756659334461284756482337867831
652712019091456485669234603486104543266482133936072602491412737245870
pi is
31415926535897932384626433832795028841971693993751058209749445923078164062862089
98628034825342117067982148086513282306647093844609550582231725359408128481117450
28410270193852110555964462294895493038196442881097566593344612847564823378678316
527120190914564856692346034861045432664821339360726024914127372458700
--
RGB
------------------------------
Date: Thu, 24 Jul 2008 21:21:18 GMT
From: sln@netherlands.com
Subject: Re: number of maximum decimal places supported with Perl
Message-Id: <qash84p1tbk5hkt5jvsqep7864uthkb3ju@4ax.com>
On Thu, 24 Jul 2008 21:31:30 +0100, RedGrittyBrick <RedGrittyBrick@SpamWeary.foo> wrote:
>sln@netherlands.com wrote:
>> On Thu, 24 Jul 2008 20:26:50 +0100, RedGrittyBrick <RedGrittyBrick@SpamWeary.foo> wrote:
>>
>>> Jack wrote:
>>>> On Jul 22, 4:29 pm, Leon Timmermans <faw...@gmail.com> wrote:
>>>>> On Tue, 22 Jul 2008 16:17:15 -0700, Jack wrote:
>>>>>> Hi there, does anyone know what data type has the most digits of
>>>>>> precision perl, and what the upper bound (maximum) number of decimal
>>>>>> places is for that data type ?
>>>>>> Thank you,
>>>>>> Jack
>>>>> I don't think there is a clearly defined maximum, but if you need to rely
>>>>> on it Math::BigFloat supports arbitrary precision floating point math.
>>>>>
>>>>> Leon Timmermans
>>>> Great, and thank you, do you happen to know is the maximum number of
>>>> digits supported on the left hand (positive) side of the decimal ?
>>>>
>>> About 308?
>>
>> 308 digit mantissa. Really?
>
>#!/usr/bin/perl
>use strict;
>use warnings;
>use Math::BigFloat;
>
>my $pi = Math::BigFloat->bpi(308);
>print "pi is $pi\n\n";
>
>my $m = Math::BigFloat->new(1E308);
>$pi->bmul($m);
>print "pi is $pi\n\n";
>
>
>C:\Users\Ian\Documents>perl big.pl
>pi is
>3.141592653589793238462643383279502884197169399375105820974944592307816406286208
>99862803482534211706798214808651328230664709384460955058223172535940812848111745
>02841027019385211055596446229489549303819644288109756659334461284756482337867831
>652712019091456485669234603486104543266482133936072602491412737245870
>
>pi is
>31415926535897932384626433832795028841971693993751058209749445923078164062862089
>98628034825342117067982148086513282306647093844609550582231725359408128481117450
>28410270193852110555964462294895493038196442881097566593344612847564823378678316
>527120190914564856692346034861045432664821339360726024914127372458700
This is a moving calculation, converted to a string.
I'm thinking of something else, like the largest possible decimal that can be
calculated in the fp machine register.
You got shit fo brains my friend.
sln
------------------------------
Date: Fri, 25 Jul 2008 00:04:34 +0100
From: RedGrittyBrick <RedGrittyBrick@SpamWeary.foo>
Subject: Re: number of maximum decimal places supported with Perl
Message-Id: <wvmdncS9ou0ZlxTVnZ2dneKdnZydnZ2d@bt.com>
sln@netherlands.com wrote:
> On Thu, 24 Jul 2008 20:26:50 +0100, RedGrittyBrick <RedGrittyBrick@SpamWeary.foo> wrote:
>
>> Jack wrote:
>>> Leon Timmermans wrote:
>>>> Jack wrote:
>>>>>
>>>>> Hi there, does anyone know what data type has the most digits of
>>>>> precision perl, and what the upper bound (maximum) number of decimal
>>>>> places is for that data type ?
>>>>>
>>>> I don't think there is a clearly defined maximum, but if you need to rely
>>>> on it Math::BigFloat supports arbitrary precision floating point math.
>>>>
>>> Great, and thank you, do you happen to know is the maximum number of
>>> digits supported on the left hand (positive) side of the decimal ?
>>>
>> About 308?
>
> 308 digit mantissa. Really?
Not really. Bigger. Much much bigger.
--
RGB
------------------------------
Date: Thu, 24 Jul 2008 19:18:53 -0500
From: Tad J McClellan <tadmc@seesig.invalid>
Subject: Re: number of maximum decimal places supported with Perl
Message-Id: <slrng8i6vd.4pm.tadmc@tadmc30.sbcglobal.net>
sln@netherlands.com <sln@netherlands.com> wrote:
> You got shit fo brains my friend.
You sure do treat your friends badly.
--
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"
------------------------------
Date: Fri, 25 Jul 2008 07:12:56 GMT
From: tadmc@seesig.invalid
Subject: Posting Guidelines for comp.lang.perl.misc ($Revision: 1.8 $)
Message-Id: <Y1fik.5762$np7.3559@flpi149.ffdc.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: Thu, 24 Jul 2008 19:19:34 -0500
From: Tad J McClellan <tadmc@seesig.invalid>
Subject: Re: Profiling?
Message-Id: <slrng8i70m.4pm.tadmc@tadmc30.sbcglobal.net>
Alex Buell <alex.buell@munted.org.uk> wrote:
> Is there a way to profile a Perl program? for example, see where it
> spends most of its time doing things? Thanks!
Your Question is Asked Frequently:
perldoc -q profile
--
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"
------------------------------
Date: Fri, 25 Jul 2008 01:03:50 +0200
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: Undefined behaviour
Message-Id: <slrng8i2io.dfc.hjp-usenet2@hrunkner.hjp.at>
On 2008-07-23 23:16, Joost Diepenmaat <joost@zeekat.nl> wrote:
> "Peter J. Holzer" <hjp-usenet2@hjp.at> writes:
>
>> On 2008-07-22 18:07, Joost Diepenmaat <joost@zeekat.nl> wrote:
>>> "szr" <szrRE@szromanMO.comVE> writes:
>>>
>>>>> $tail = ($tail->[1] = [$_]);
>>>> ^^^^^^^^^^^^^^^^^^^^^
>>>>
>>>> Is it any surprise that it segfaults when you're using a construct with
>>>> undefined behavior?
>>>
>>> how is that behaviour undefined?
>>
>> perldoc perlop:
>>
>> Note that just as in C, Perl doesn’t define when the variable is
>> incremented or decremented. You just know it will be done sometime
>> before or after the value is returned. This also means that modifying a
>> variable twice in the same statement will lead to undefined behaviour.
>
> That specifically applies to constructs such as
>
> $b = ++$a + ++$a;
As I wrote (as you would have noticed if you had bothered to read a few
lines more) it is *not* clear what this applies to.
> *not* to the kind of construct I used above. Also note that I'm *not*
> modifying any variable twice.
As I wrote (as you would have noticed if you had bothered to read a few
lines more) this is immaterial, since in C there are also restriction on
accessing a variable which is modified between the same sequence points,
so *if* Perl behaves "just as in C" (which as I wrote, is not clear).
> Also this may or may not be relevant (from the perlop chapter on assignment):
>
> Unlike in C, the scalar assignment operator produces a valid
> lvalue. Modifying an assignment is equivalent to doing the
> assignment and then modifying the variable that was assigned
> to.
>
Yup. That's one of the reasons why I wrote:
>> But I don't think C rules apply to Perl. The languages are too
>> different
as you would have noticed if you had bothered to read a few
lines more.
hp
------------------------------
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 1746
***************************************