[30340] in Perl-Users-Digest
Perl-Users Digest, Issue: 1583 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed May 28 03:09:39 2008
Date: Wed, 28 May 2008 00:09:05 -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 Wed, 28 May 2008 Volume: 11 Number: 1583
Today's topics:
Re: arrow key bindings in perl debugger mode <andrew.c.stewart@gmail.com>
Re: arrow key bindings in perl debugger mode <andrew.c.stewart@gmail.com>
Re: Consolidating a list of networks in Perl (J.D. Baldwin)
Re: How do I handle an unknown number of keys to hash? <szrRE@szromanMO.comVE>
Re: How do I handle an unknown number of keys to hash? <uri@stemsystems.com>
new CPAN modules on Wed May 28 2008 (Randal Schwartz)
Re: Perldoc recommendation <dragnet\_@_/internalysis.com>
Re: Why reading the FAQs is good (example) <szrRE@szromanMO.comVE>
Re: Why reading the FAQs is good (example) <dragnet\_@_/internalysis.com>
Re: Win32 OLE Excel existing <brian.helterline@hp.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 27 May 2008 12:05:42 -0700 (PDT)
From: andrew <andrew.c.stewart@gmail.com>
Subject: Re: arrow key bindings in perl debugger mode
Message-Id: <503b4598-44b6-4608-afb9-1a190daaa9df@y38g2000hsy.googlegroups.com>
On May 15, 7:32=A0pm, Michael Carman <mjcar...@mchsi.com> wrote:
> andrew wrote:
> > Hmm, these two modules are installed, but it's not exactly clear to me
> > how to use them to customize key bindings.
>
> Something else must be wrong, then. The default bindings for those keys
> matches the functionality you wanted.
>
> -mjc
You're right, because now it suddenly works after starting a new
session on the machine in question. :D
------------------------------
Date: Tue, 27 May 2008 12:45:11 -0700 (PDT)
From: andrew <andrew.c.stewart@gmail.com>
Subject: Re: arrow key bindings in perl debugger mode
Message-Id: <de8cdc68-c6cf-4476-a9c4-d1c22db39302@79g2000hsk.googlegroups.com>
Ok I figured it out. Just make sure to update Bundle::CPAN afterwards
if it's not already. I was working on a cpan configuration and hadn't
bothered to do it yet.
------------------------------
Date: Wed, 28 May 2008 00:29:47 +0000 (UTC)
From: INVALID_SEE_SIG@example.com.invalid (J.D. Baldwin)
Subject: Re: Consolidating a list of networks in Perl
Message-Id: <g1i91r$jn7$1@reader2.panix.com>
In the previous article, Ben Morrow <ben@morrow.me.uk> wrote:
> Net::CIDR::Lite will do exactly this.
And, while I already responded that I thought this was the answer, I
just want to note that it really, really was. I got a good result out
of that with almost no effort. (It even pulled in my IP ranges *as*
ranges, without even making use of the work I'd done to convert them
to net/mask form. Very cool.)
--
_+_ From the catapult of |If anyone disagrees with any statement I make, I
_|70|___:)=}- J.D. Baldwin |am quite prepared not only to retract it, but also
\ / baldwin@panix.com|to deny under oath that I ever made it. -T. Lehrer
***~~~~-----------------------------------------------------------------------
------------------------------
Date: Tue, 27 May 2008 12:01:46 -0700
From: "szr" <szrRE@szromanMO.comVE>
Subject: Re: How do I handle an unknown number of keys to hash?
Message-Id: <g1hlqq0174v@news4.newsguy.com>
Jens Thoms Toerring wrote:
> grocery_stocker <cdalten@gmail.com> wrote:
>> Given
>
>> #!/usr/bin/perl -w
>> my %ages = ('a' => 1, 'b' => 1, 'c' => 1);
>
>> Sometimes 'c' will appear in the list, but other times it won't. Ie
>> sometimes I'll get
>
>> %ages = ('a' => 1, 'b' => 1);
>
>> This becomes an issue when I try to extract 'c' later on.
>
>> #!/usr/bin/perl -w
>> my %ages = ('a' => 1, 'b' => 1);
>> print $ages{'c'}, "\n";
>
>> /or.pl
>> Use of uninitialized value in print at ./or.pl line 5.
>
>> When this happens, this should print out NULL;
>
> The test to see if a hash key exists uses the appriately
> named funtion exists():
>
> print exists $ages{c} ? $ages{c} : "NULL", "\n";
>
> This will print out "NULL" if no such key exists in the
> hash. But you may also want to print "NULL" if 'c' exists
> as a hash key but the corresponding value is undefined
> (otherwise you get the same warning but for a different
> reason). In that case you can use instead the also appro-
> riately named function defined():
>
> print defined $ages{c} ? $ages{c} : "NULL", "\n";
'defined' has the side effect of auto creating that key, so would it not
be better to use something like,
print exists $ages{c} && defined $ages{c} ?
$ages{c} : "NULL", "\n";
to prevent that auto creation (if that is a concern to the beholder) ?
--
szr
------------------------------
Date: Tue, 27 May 2008 19:15:26 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: How do I handle an unknown number of keys to hash?
Message-Id: <x7ej7n8soi.fsf@mail.sysarch.com>
>>>>> "s" == szr <szrRE@szromanMO.comVE> writes:
s> Jens Thoms Toerring wrote:
>> grocery_stocker <cdalten@gmail.com> wrote:
>>
>> print exists $ages{c} ? $ages{c} : "NULL", "\n";
>>
>> This will print out "NULL" if no such key exists in the
>> hash. But you may also want to print "NULL" if 'c' exists
>> as a hash key but the corresponding value is undefined
>> (otherwise you get the same warning but for a different
>> reason). In that case you can use instead the also appro-
>> riately named function defined():
>>
>> print defined $ages{c} ? $ages{c} : "NULL", "\n";
s> 'defined' has the side effect of auto creating that key, so would it not
s> be better to use something like,
no it doesn't. accessing DEEP keys will autovivify higher level keys but
nothing will autovivify when doing a top level access.
s> print exists $ages{c} && defined $ages{c} ?
s> $ages{c} : "NULL", "\n";
s> to prevent that auto creation (if that is a concern to the beholder) ?
not needed. exists and defined don't autovivify top level accesses. in
fact they don't do anything special. it is the expression they work upon
that may autovivify if the access is deeper. see my article on
autovivification:
http://sysarch.com/Perl/autoviv.txt
and someone posted the perl 5.10 solution of // which is nice if you can
use 5.10.
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.sysarch.com --
----- Perl Code Review , Architecture, Development, Training, Support ------
--------- Free Perl Training --- http://perlhunter.com/college.html ---------
--------- Gourmet Hot Cocoa Mix ---- http://bestfriendscocoa.com ---------
------------------------------
Date: Wed, 28 May 2008 04:42:18 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Wed May 28 2008
Message-Id: <K1KAEI.1Lzw@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-PSON-0.04
http://search.cpan.org/~tomyhero/Acme-PSON-0.04/
PSON(PerlScript Object Notation) Module
----
Apache2-ASP-1.47
http://search.cpan.org/~johnd/Apache2-ASP-1.47/
Perl extension for ASP on mod_perl2.
----
App-Addex-AddressBook-Apple-0.012
http://search.cpan.org/~rjbs/App-Addex-AddressBook-Apple-0.012/
use Apple Address Book as the addex source
----
CGI-RSS-0.7.3
http://search.cpan.org/~jettero/CGI-RSS-0.7.3/
provides a CGI-like interface for making rss feeds
----
CPAN-CachingProxy-1.0.2
http://search.cpan.org/~jettero/CPAN-CachingProxy-1.0.2/
A very simple lightweight CGI based Caching Proxy
----
Cache-Memcached-libmemcached-0.02007
http://search.cpan.org/~dmaki/Cache-Memcached-libmemcached-0.02007/
Perl Interface to libmemcached
----
Catalyst-Controller-BindLex-0.05
http://search.cpan.org/~mstrout/Catalyst-Controller-BindLex-0.05/
Unmaintained, dangerous proof of concept
----
Catalyst-Plugin-Cache-0.06
http://search.cpan.org/~jrobinson/Catalyst-Plugin-Cache-0.06/
Flexible caching support for Catalyst.
----
Catalyst-Plugin-CustomErrorMessage-0.03_01
http://search.cpan.org/~jkutej/Catalyst-Plugin-CustomErrorMessage-0.03_01/
Catalyst plugin to have more "cute" error message.
----
Crypt-Skip32-0.08
http://search.cpan.org/~esh/Crypt-Skip32-0.08/
32-bit block cipher based on Skipjack
----
DBD-Ingres-0.5202
http://search.cpan.org/~sreagle/DBD-Ingres-0.5202/
DBI driver for Ingres database systems
----
DBIx-Perlish-0.40
http://search.cpan.org/~gruber/DBIx-Perlish-0.40/
a perlish interface to SQL databases
----
DBM-Deep-1.0010
http://search.cpan.org/~rkinyon/DBM-Deep-1.0010/
A pure perl multi-level hash/array DBM that supports transactions
----
DBM-Deep-1.0011
http://search.cpan.org/~rkinyon/DBM-Deep-1.0011/
A pure perl multi-level hash/array DBM that supports transactions
----
DateTime-TimeZone-0.77
http://search.cpan.org/~drolsky/DateTime-TimeZone-0.77/
Time zone object base class and factory
----
Devel-FindBlessedRefs-1.0.4
http://search.cpan.org/~jettero/Devel-FindBlessedRefs-1.0.4/
find all refs blessed under a package
----
Encode-Detect-1.01
http://search.cpan.org/~jgmyers/Encode-Detect-1.01/
An Encode::Encoding subclass that detects the encoding of data
----
Games-Bowling-Scorecard-0.102
http://search.cpan.org/~rjbs/Games-Bowling-Scorecard-0.102/
score your bowling game easily
----
Games-RolePlay-MapGen-1.2.20
http://search.cpan.org/~jettero/Games-RolePlay-MapGen-1.2.20/
The base object for generating dungeons and maps
----
Geo-Ellipsoids-0.16
http://search.cpan.org/~mrdvt/Geo-Ellipsoids-0.16/
Package for standard Geo:: ellipsoid a, b, f and 1/f values.
----
HTML-Stream-1.56
http://search.cpan.org/~dstaal/HTML-Stream-1.56/
HTML output stream class, and some markup utilities
----
InSilicoSpectro-1.3.20
http://search.cpan.org/~alexmass/InSilicoSpectro-1.3.20/
Open source Perl library for proteomics
----
Lirc-Client-1.51
http://search.cpan.org/~mgrimes/Lirc-Client-1.51/
A client library for the Linux Infrared Remote Control
----
Log-Fine-0.12
http://search.cpan.org/~cfuhrman/Log-Fine-0.12/
Yet another logging framework
----
Log-Fine-0.12.1
http://search.cpan.org/~cfuhrman/Log-Fine-0.12.1/
Yet another logging framework
----
Log-Fine-0.13
http://search.cpan.org/~cfuhrman/Log-Fine-0.13/
Yet another logging framework
----
MARC-Charset-1.0
http://search.cpan.org/~esummers/MARC-Charset-1.0/
convert MARC-8 encoded strings to UTF-8
----
Memcached-libmemcached-0.2101
http://search.cpan.org/~timb/Memcached-libmemcached-0.2101/
Thin fast full interface to the libmemcached client API
----
MySQL-Easy-2.0.3
http://search.cpan.org/~jettero/MySQL-Easy-2.0.3/
Perl extension to handle various mundane DBI session related things specific to mysql.
----
Net-Akamai-0.11
http://search.cpan.org/~jgoulah/Net-Akamai-0.11/
Utility to interface with Akamai's API
----
Net-SMTP-OneLiner-1.3.2
http://search.cpan.org/~jettero/Net-SMTP-OneLiner-1.3.2/
extension that polutes the local namespace with a send_mail() function.
----
Net-SMTP-OneLiner-1.3.3
http://search.cpan.org/~jettero/Net-SMTP-OneLiner-1.3.3/
extension that polutes the local namespace with a send_mail() function.
----
Net-Server-Mail-ESMTP-SIZE-0.02
http://search.cpan.org/~jlmartin/Net-Server-Mail-ESMTP-SIZE-0.02/
add support for the SIZE ESMTP extension to Net::Server::Mail
----
Number-Phone-1.6
http://search.cpan.org/~dcantrell/Number-Phone-1.6/
base class for Number::Phone::* modules
----
ORLite-0.04
http://search.cpan.org/~adamk/ORLite-0.04/
Extremely light weight SQLite-specific ORM
----
ORLite-0.05
http://search.cpan.org/~adamk/ORLite-0.05/
Extremely light weight SQLite-specific ORM
----
ORLite-0.06
http://search.cpan.org/~adamk/ORLite-0.06/
Extremely light weight SQLite-specific ORM
----
ORLite-0.07
http://search.cpan.org/~adamk/ORLite-0.07/
Extremely light weight SQLite-specific ORM
----
ORLite-Mirror-0.01
http://search.cpan.org/~adamk/ORLite-Mirror-0.01/
Extend ORLite to support remote SQLite databases
----
POE-Component-Pluggable-1.06
http://search.cpan.org/~bingos/POE-Component-Pluggable-1.06/
A base class for creating plugin enabled POE Components.
----
POSIX-Regex-0.90.10
http://search.cpan.org/~jettero/POSIX-Regex-0.90.10/
OO interface for the gnu regex engine
----
Passwd-Unix-0.41
http://search.cpan.org/~strzelec/Passwd-Unix-0.41/
----
Sman-1.03
http://search.cpan.org/~joshr/Sman-1.03/
Tool for searching and indexing man pages
----
Sys-Info-Driver-Windows-XS-0.10
http://search.cpan.org/~burak/Sys-Info-Driver-Windows-XS-0.10/
XS Wrappers for Sys::Info Windows driver
----
Test-MockObject-1.09
http://search.cpan.org/~chromatic/Test-MockObject-1.09/
Perl extension for emulating troublesome interfaces
----
Test-SMTP-0.03
http://search.cpan.org/~jlmartin/Test-SMTP-0.03/
Module for writing SMTP Server tests
----
Time-Format-1.08
http://search.cpan.org/~roode/Time-Format-1.08/
Easy-to-use date/time formatting.
----
Time-Format-1.09
http://search.cpan.org/~roode/Time-Format-1.09/
Easy-to-use date/time formatting.
----
Time-Normalize-0.08
http://search.cpan.org/~roode/Time-Normalize-0.08/
Convert time and date values into standardized components.
----
Unix-Process-1.2.2
http://search.cpan.org/~jettero/Unix-Process-1.2.2/
Perl extension to get pid info from (/bin/ps).
----
W3C-LogValidator-1.3
http://search.cpan.org/~oliviert/W3C-LogValidator-1.3/
The W3C Log Validator - Quality-focused Web Server log processing engine
----
WWW-Myspace-0.80
http://search.cpan.org/~grantg/WWW-Myspace-0.80/
Access MySpace.com profile information from Perl
----
WebService-Simple-Google-Chart-0.04
http://search.cpan.org/~yusukebe/WebService-Simple-Google-Chart-0.04/
Get Google Chart URL and image file
----
XML-API-0.20
http://search.cpan.org/~mlawren/XML-API-0.20/
Perl extension for writing XML
----
XML-API-0.21
http://search.cpan.org/~mlawren/XML-API-0.21/
Perl extension for writing XML
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: Tue, 27 May 2008 18:38:59 -0500
From: Marc Bissonnette <dragnet\_@_/internalysis.com>
Subject: Re: Perldoc recommendation
Message-Id: <Xns9AABC7E394129dragnetinternalysisc@216.196.97.131>
Jürgen Exner <jurgenex@hotmail.com> fell face-first on the keyboard.
This was the result: news:b3em3493oqdc765a223qvce7fi9em5r6vq@4ax.com:
> Marc Bissonnette <dragnet\_@_/internalysis.com> wrote:
>>Sadly, my machine here is Windows Vista (Yes, I know - boneheaded)
>>with my work being done on remote machines. While perl is installed
>>locally, Microsoft decided brilliantly (!!!) to make the DOS box only
>>open in a narrow window - For someone who's eyesight isn't what it
>>used to be, this doesn't make for great long content reading :(
>
> May Vista be good or bad, it always amuses me how people love to
> participate in Microsoft bashing using arguments that tell more about
> their (lack of) intelligence than about the Microsoft product in
> question:
> 1: the maximum size of a CMD Window on Vista is limited by the number
> of rows and columns selected. This is exactly the same as on XP.
> 2: the number of lines and columns can be configured as the user
> likes. See Properties -> Window Size. This is exactly the same as on
> XP. 3: the default number of lines and columns can be configured as
> the user likes. See Defaults -> Layout. This is exactly the same as on
> XP. 4: the font size can be set up to 72pixel even without
> accessibility, see Properties -> Font or Defaults -> Font. This is
> exactly the same as on XP.
>
> Maybe if you don't know how to use your tools you could ask about how
> to use your tools rather then complaining about Sthil because it is so
> hard to use their chain saws when you never even knew how to turn on
> the engine in the first place.
Well, as mean-spirited as that response was - it was correct and I have
indeed learned something new - for that, thank you.
What you *got* out of being a crotchety old fart in that <shrug> Hope it
makes you feel the bigger person.
--
Marc Bissonnette
Looking for a new ISP? http://www.canadianisp.com
Largest ISP comparison site across Canada.
------------------------------
Date: Tue, 27 May 2008 11:51:32 -0700
From: "szr" <szrRE@szromanMO.comVE>
Subject: Re: Why reading the FAQs is good (example)
Message-Id: <g1hl7l015nn@news4.newsguy.com>
Uri Guttman wrote:
>>>>>> "s" == szr <szrRE@szromanMO.comVE> writes:
>
> s> Abigail wrote:
>
> >> Note that using lowercase for "pragmata" is just a convention. Perl
> >> itself doesn't care at all about the casing (as long as it
> >> matches),
> >> nor does
>
> s> Doesn't "care" where? In the 'use' statement, it most certainly
> does
> s> matter. And if you install every module as lowercase, you're
> definitely
> s> going to have problems running someone else's code that uses the
> correct
> s> casing. Saying Perl doesn't care about casing is misleading at
> best. In
> s> general, casing in Perl matters very much.
>
> you didn't read abigail's post correctly. he means that the case of
> the name doesn't matter in regards to what kind of module (pragma or
> not) it is.
Ok, fair enough, and I am sorry, though I still find the way he wrote
that to be a bit misleading.
> the convention (not a syntax or semantic requirement) is pragmas
> are named in all lower case and regular modules are in StudlyCaps.
> this has nothing to do with the use statement nor about case
> matching of file
Got it.
--
szr
------------------------------
Date: Tue, 27 May 2008 18:41:15 -0500
From: Marc Bissonnette <dragnet\_@_/internalysis.com>
Subject: Re: Why reading the FAQs is good (example)
Message-Id: <Xns9AABC8459787Bdragnetinternalysisc@216.196.97.131>
Tad J McClellan <tadmc@seesig.invalid> fell face-first on the keyboard.
This was the result: news:slrng3mpng.86l.tadmc@tadmc30.sbcglobal.net:
> Marc Bissonnette <dragnet> wrote:
>> Tad J McClellan <tadmc@seesig.invalid> fell face-first on the keyboard.
>> This was the result: news:slrng3lpcs.38a.tadmc@tadmc30.sbcglobal.net:
>>
>>> Marc Bissonnette <dragnet> wrote:
>
>
>>>> if ($in{hours} !~ /^-?\d+\.?\d*$/) {
>>>
>>> I'd prefer to write that as:
>>>
>>> unless ($in{hours} =~ /^-?\d+\.?\d*$/) {
>>>
>>> as that puts the "not" out where it is harder to miss...
>>
>> Maybe a silly question, but would that mean that if there are only two
>> conditions (true|false), use unless and if there are more than two, use
>> if/elsif as better code ?
>
>
> No, I wouldn't say that.
>
> I'd say if there is a single _clause_ you can choose between
> saying "if not" or "unless".
>
> If there are two clauses, use an if-else (I never use an unless-else).
Ahh, gotcha - thank you!
--
Marc Bissonnette
Looking for a new ISP? http://www.canadianisp.com
Largest ISP comparison site across Canada.
------------------------------
Date: Tue, 27 May 2008 12:25:30 -0700
From: Brian Helterlilne <brian.helterline@hp.com>
Subject: Re: Win32 OLE Excel existing
Message-Id: <g1hn75$lt0$1@usenet01.boi.hp.com>
Slickuser wrote:
> Is there a way to check if Excel exist beside checking the full path
> of Excel or use use Win32::OLE::Const 'Microsoft Excel'?
you can look in the registry, just like Win32::OLE::Const does
>
> Also, is there a way to tell which Excel they are using such as Office
> 2003 (11) or Office 2007 (12)?
$excel->{VERSION} will return what you want.
>
> Thanks.
------------------------------
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 1583
***************************************