[30339] in Perl-Users-Digest
Perl-Users Digest, Issue: 1582 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue May 27 14:09:50 2008
Date: Tue, 27 May 2008 11:09:11 -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, 27 May 2008 Volume: 11 Number: 1582
Today's topics:
Re: Consolidating a list of networks in Perl (J.D. Baldwin)
disjoint copy one hash to another <ramprasad.ap@gmail.com>
Re: disjoint copy one hash to another (Jens Thoms Toerring)
Re: disjoint copy one hash to another <1usa@llenroc.ude.invalid>
Re: disjoint copy one hash to another <ben@morrow.me.uk>
Re: FAQ 4.65 How can I store a multidimensional array i <brian.d.foy@gmail.com>
How do I handle an unknown number of keys to hash? <cdalten@gmail.com>
Re: How do I handle an unknown number of keys to hash? <simon.chao@fmr.com>
Re: How do I handle an unknown number of keys to hash? <cdalten@gmail.com>
Re: How do I handle an unknown number of keys to hash? (Jens Thoms Toerring)
Re: How do I handle an unknown number of keys to hash? <bugbear@trim_papermule.co.uk_trim>
Re: How do I handle an unknown number of keys to hash? <jurgenex@hotmail.com>
Re: How do I handle an unknown number of keys to hash? <ben@morrow.me.uk>
Re: How do I handle an unknown number of keys to hash? <jurgenex@hotmail.com>
Re: IPC::Shareable. Does it work? <tzz@lifelogs.com>
Re: Parsing <tzz@lifelogs.com>
Re: Perldoc recommendation <ramesh.thangamani@gmail.com>
Re: reinstall perl <yingun@gmail.com>
Re: reinstall perl <szrRE@szromanMO.comVE>
Re: Why reading the FAQs is good (example) <abigail@abigail.be>
Re: Why reading the FAQs is good (example) <szrRE@szromanMO.comVE>
Re: Why reading the FAQs is good (example) <uri@stemsystems.com>
Win32 OLE Excel existing <slick.users@gmail.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 27 May 2008 12:09:10 +0000 (UTC)
From: INVALID_SEE_SIG@example.com.invalid (J.D. Baldwin)
Subject: Re: Consolidating a list of networks in Perl
Message-Id: <g1gtl6$6h8$1@reader2.panix.com>
In the previous article, Ben Morrow <ben@morrow.me.uk> wrote:
> Net::CIDR::Lite will do exactly this.
So it will, thanks! I see that if I'd searched "merging IP ranges"
instead of "consolidating" I might have found that on my own.
Bjoern Hoehrmann's idea was also a good one. My own idea was to do a
class-C hash (with elements 1.2.3.x->{0},{1},{...}, check for elements
with 255 members, then fill the class B hashes (1.2.y->{0},{1},{...})
and work from there. But Net::CIDR::Lite looks like it will do the
job. Thanks, again.
--
_+_ 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 03:04:18 -0700 (PDT)
From: "ram@pragatee.com" <ramprasad.ap@gmail.com>
Subject: disjoint copy one hash to another
Message-Id: <9f4a33ad-de88-47bc-80e9-af618e3dece4@i36g2000prf.googlegroups.com>
When I create a copy of a hash array, the operation on the copy hash
seems to affect the original hash
( when the values are reference elements )
How do I avoid this ?
In the following script %y is a copy hash , but change that and the %x
original hash is affected
--------------
#!/usr/bin/perl
use strict;
use warnings;
my %x = ( a => [1]);
foreach my $i( 1 .. 5){
my %y = %x;
push @{$y{a}},5;
print "[Loop $i] " . join(" ",@{$x{a}}) ."\n"; # I want
this to be same in every loop
}
----------------
Output
---------
[Loop 1] 1 5
[Loop 2] 1 5 5
[Loop 3] 1 5 5 5
[Loop 4] 1 5 5 5 5
[Loop 5] 1 5 5 5 5 5
-------------
But I dont want the original %x to get affected. How do I do this ?
Thanks
Ram
PS:
Note to Spammers: Go ahead , send me spam
ram@pragatee.com
http://pragatee.com
------------------------------
Date: 27 May 2008 10:27:51 GMT
From: jt@toerring.de (Jens Thoms Toerring)
Subject: Re: disjoint copy one hash to another
Message-Id: <6a2617F35q0ihU1@mid.uni-berlin.de>
ram@pragatee.com <ramprasad.ap@gmail.com> wrote:
> When I create a copy of a hash array, the operation on the copy hash
> seems to affect the original hash
> ( when the values are reference elements )
> In the following script %y is a copy hash , but change that and the %x
> original hash is affected
> --------------
> #!/usr/bin/perl
> use strict;
> use warnings;
> my %x = ( a => [1]);
So $x{a} is an array reference, not an array. So $x{a} is
a pointer to an array that's stored somewhere in memory.
> foreach my $i( 1 .. 5){
> my %y = %x;
Here this copy copies the reference, so $x{a} and $y{a} now
point to the same array. The copy operation isn't a "deep
copy" that instead of copying the reference copies what it
points to. A "deep copy" would result in a comparison like
$x{a} == $y{a}
to fail (unless you also change the meaning of the '=='
operator etc. if applied to references) which could get a
bit surprising...
> push @{$y{a}},5;
And here you change the array that both $x{a} and $y{a} point
to.
> How do I avoid this ?
To get around that you will have to create a new array which
$y{a} pointis to and copy the elements of the array $x{a}
points to. So use not just
my %y = %x;
but add
$y{a} = [ @{$x{a}} ];
before you start to change $y{a}.
Regards, Jens
--
\ Jens Thoms Toerring ___ jt@toerring.de
\__________________________ http://toerring.de
------------------------------
Date: Tue, 27 May 2008 10:33:55 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: disjoint copy one hash to another
Message-Id: <Xns9AAB42C849969asu1cornelledu@127.0.0.1>
"ram@pragatee.com" <ramprasad.ap@gmail.com> wrote in news:9f4a33ad-de88-
47bc-80e9-af618e3dece4@i36g2000prf.googlegroups.com:
> When I create a copy of a hash array, the operation on the copy hash
> seems to affect the original hash
> ( when the values are reference elements )
>
> How do I avoid this ?
See dclone in Storable:
http://search.cpan.org/~ams/Storable-2.18/Storable.pm
Sinan
--
A. Sinan Unur <1usa@llenroc.ude.invalid>
(remove .invalid and reverse each component for email address)
comp.lang.perl.misc guidelines on the WWW:
http://www.rehabitation.com/clpmisc/
------------------------------
Date: Tue, 27 May 2008 11:47:17 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: disjoint copy one hash to another
Message-Id: <le5tg5-1n2.ln1@osiris.mauzo.dyndns.org>
Quoth "ram@pragatee.com" <ramprasad.ap@gmail.com>:
> When I create a copy of a hash array, the operation on the copy hash
> seems to affect the original hash
> ( when the values are reference elements )
>
> How do I avoid this ?
use Clone; # or one of the Clone::* alternatives
Ben
--
"If a book is worth reading when you are six, * ben@morrow.me.uk
it is worth reading when you are sixty." [C.S.Lewis]
------------------------------
Date: Tue, 27 May 2008 10:30:59 +0200
From: brian d foy <brian.d.foy@gmail.com>
Subject: Re: FAQ 4.65 How can I store a multidimensional array in a DBM file?
Message-Id: <270520081030590723%brian.d.foy@gmail.com>
In article <g1g32o02ln2@news4.newsguy.com>, szr <szrRE@szromanMO.comVE>
wrote:
> PerlFAQ Server wrote:
> [...]
> > 4.65: How can I store a multidimensional array in a DBM file?
> >
> > Either stringify the structure yourself (no fun), or else get the
> > MLDBM (which uses Data::Dumper) module from CPAN and layer it on
> > top of either DB_File or GDBM_File.
>
> It may be worth mentioning, that while Data::Dumper can work well,
> sometimes it maybe be useful to use a module such as PHP::Serialization
> if you are sharing data with a language (like PHP) that support that
> type of serialization.
Interesting suggestion, but I don't want to turn the answer into a
catalog of serialization modules (especially when the question is not
really about anything other than DBM). The question mostly exists
because some of the DBM implementations are quite limited in handling
data so you have to ask those sorts of questions. :)
------------------------------
Date: Tue, 27 May 2008 09:24:34 -0700 (PDT)
From: grocery_stocker <cdalten@gmail.com>
Subject: How do I handle an unknown number of keys to hash?
Message-Id: <0a333938-483a-42c1-a0c3-cfe85b214126@c19g2000prf.googlegroups.com>
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;
I was thinking about filling %ages with a bunch of 'undef'=>1. Ideas?
------------------------------
Date: Tue, 27 May 2008 09:28:56 -0700 (PDT)
From: nolo contendere <simon.chao@fmr.com>
Subject: Re: How do I handle an unknown number of keys to hash?
Message-Id: <e06067ce-289f-4bf1-bdbe-2cb1e5ad3d31@a1g2000hsb.googlegroups.com>
On May 27, 12:24=A0pm, grocery_stocker <cdal...@gmail.com> wrote:
> Given
>
> #!/usr/bin/perl -w
>
> my %ages =3D ('a' =3D> 1, 'b' =3D> 1, 'c' =3D> 1);
>
> Sometimes 'c' will appear in the list, but other times it won't. Ie
> sometimes I'll get
>
> %ages =3D ('a' =3D> 1, 'b' =3D> 1);
>
> This becomes an issue when I try to extract 'c' later on.
>
> #!/usr/bin/perl -w
>
> my %ages =3D ('a' =3D> 1, 'b' =3D> 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;
>
> I was thinking about filling %ages with a bunch of 'undef'=3D>1. =A0Ideas?=
just check to see if the key exists:
print $ages{c}, "\n" if exists $ages{c};
------------------------------
Date: Tue, 27 May 2008 09:34:11 -0700 (PDT)
From: grocery_stocker <cdalten@gmail.com>
Subject: Re: How do I handle an unknown number of keys to hash?
Message-Id: <5391746b-9f63-4abf-9f3e-435b6c614f24@j33g2000pri.googlegroups.com>
On May 27, 9:28=A0am, nolo contendere <simon.c...@fmr.com> wrote:
> On May 27, 12:24=A0pm, grocery_stocker <cdal...@gmail.com> wrote:
>
>
>
>
>
> > Given
>
> > #!/usr/bin/perl -w
>
> > my %ages =3D ('a' =3D> 1, 'b' =3D> 1, 'c' =3D> 1);
>
> > Sometimes 'c' will appear in the list, but other times it won't. Ie
> > sometimes I'll get
>
> > %ages =3D ('a' =3D> 1, 'b' =3D> 1);
>
> > This becomes an issue when I try to extract 'c' later on.
>
> > #!/usr/bin/perl -w
>
> > my %ages =3D ('a' =3D> 1, 'b' =3D> 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;
>
> > I was thinking about filling %ages with a bunch of 'undef'=3D>1. =A0Idea=
s?
>
> just check to see if the key exists:
>
> print $ages{c}, "\n" if exists $ages{c};- Hide quoted text -
>
> - Show quoted text -
Okay, but if the key doesn't exist, I still need to print out value.
So if the key doesn't exist, can I then just insert the (key, value)
pair back into %ages?
------------------------------
Date: 27 May 2008 16:39:09 GMT
From: jt@toerring.de (Jens Thoms Toerring)
Subject: Re: How do I handle an unknown number of keys to hash?
Message-Id: <6a2rpdF35djs5U2@mid.uni-berlin.de>
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";
Regards, Jens
--
\ Jens Thoms Toerring ___ jt@toerring.de
\__________________________ http://toerring.de
------------------------------
Date: Tue, 27 May 2008 18:03:02 +0100
From: bugbear <bugbear@trim_papermule.co.uk_trim>
Subject: Re: How do I handle an unknown number of keys to hash?
Message-Id: <EJ6dnTe4wodbo6HVnZ2dnUVZ8h2dnZ2d@posted.plusnet>
grocery_stocker wrote:
> On May 27, 9:28 am, nolo contendere <simon.c...@fmr.com> wrote:
>> On May 27, 12:24 pm, grocery_stocker <cdal...@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;
>>> I was thinking about filling %ages with a bunch of 'undef'=>1. Ideas?
>> just check to see if the key exists:
>>
>> print $ages{c}, "\n" if exists $ages{c};- Hide quoted text -
>>
>> - Show quoted text -
>
>
> Okay, but if the key doesn't exist, I still need to print out value.
> So if the key doesn't exist, can I then just insert the (key, value)
> pair back into %ages?
>
>
sub get_age {
my ($ages, $key) = @_;
if(exists($ages->{$key}) {
return $ages->{$key};
} else {
return "NULL";
}
}
print get_age(\%ages, 'c');
(E & OE)
BugBear
------------------------------
Date: Tue, 27 May 2008 17:24:09 GMT
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: How do I handle an unknown number of keys to hash?
Message-Id: <bago34t4agqntjvmml7av7q46nbkinkh0g@4ax.com>
grocery_stocker <cdalten@gmail.com> wrote:
>%ages = ('a' => 1, 'b' => 1);
>This becomes an issue when I try to extract 'c' later on.
>print $ages{'c'}, "\n";
>/or.pl
>Use of uninitialized value in print at ./or.pl line 5.
perldoc -f exists
>When this happens, this should print out NULL;
if (exists $ages{c}) {
print "$pages{c}\n";
} else {
print 'NULL';
}
>I was thinking about filling %ages with a bunch of 'undef'=>1. Ideas?
'undef' or undef? Using the string 'undef' would just overwrite the same
entry (the one for 'undef') over and over again.
As for the constant undef I didn't try it, but I would imagine that the
string value of undef is the empty string, so you would recreate the
entry for the empty string over and over again.
Neither is any different then doing a bunch of 'foobar'=>1, which
overwrites that entry over and over again.
jue
------------------------------
Date: Tue, 27 May 2008 18:27:26 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: How do I handle an unknown number of keys to hash?
Message-Id: <usstg5-f7e.ln1@osiris.mauzo.dyndns.org>
Quoth jt@toerring.de (Jens Thoms Toerring):
>
> print defined $ages{c} ? $ages{c} : "NULL", "\n";
If you have 5.10 this can be more concisely written
say $ages{c} // "NULL";
Ben
--
BEGIN{*(=sub{$,=*)=sub{print@_};local($#,$;,$/)=@_;for(keys%{ #ben@morrow.me.uk
$#}){/m/&&next;**=${$#}{$_};/(\w):/&&(&(($#.$_,$;.$+,$/),next);$/==\$*&&&)($;.$
_)}};*_=sub{for(@_){$|=(!$|||$_||&)(q) )));&((q:\:\::,q,,,\$_);$_&&&)("\n")}}}_
$J::u::s::t, $a::n::o::t::h::e::r, $P::e::r::l, $h::a::c::k::e::r, $,
------------------------------
Date: Tue, 27 May 2008 17:34:31 GMT
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: How do I handle an unknown number of keys to hash?
Message-Id: <a4ho34pbnh4kj5kal2afjg05nr0te6tq9d@4ax.com>
grocery_stocker <cdalten@gmail.com> wrote:
>On May 27, 9:28 am, nolo contendere <simon.c...@fmr.com> wrote:
>> On May 27, 12:24 pm, grocery_stocker <cdal...@gmail.com> wrote:
>> > my %ages = ('a' => 1, 'b' => 1);
>> > print $ages{'c'}, "\n";
>> > Use of uninitialized value in print at ./or.pl line 5.
>>
>> > When this happens, this should print out NULL;
>>
>> just check to see if the key exists:
>>
>> print $ages{c}, "\n" if exists $ages{c};- Hide quoted text -
>>
>> - Show quoted text -
Why do we care about hiding or showing quoted text? What is that anyway?
>Okay, but if the key doesn't exist, I still need to print out value.
So what? Then make it a regular if ... {...} else {...} instead of just
a statement modifier.
>So if the key doesn't exist, can I then just insert the (key, value)
>pair back into %ages?
There is no law against it. But why would you want to modify the hash in
the first place?
jue
------------------------------
Date: Tue, 27 May 2008 11:21:43 -0500
From: Ted Zlatanov <tzz@lifelogs.com>
Subject: Re: IPC::Shareable. Does it work?
Message-Id: <8663szemzs.fsf@lifelogs.com>
On Mon, 26 May 2008 14:25:58 -0700 Tim Smith <reply_in_group@mouse-potato.com> wrote:
TS> The nature of some of the errors I'm getting, and the fact that the
TS> propensity to error seems to depend somewhat on the speed of the system,
TS> leads me to suspect that the problem may actually be in the tests
TS> themselves. They may have timing dependencies and race conditions.
I would recommend writing a C program to test shared memory, to be sure
the problem is not at the system level.
TS> Thus, I'm thinking of just going ahead and installing IPC::Shareable,
TS> despite the test results. Or would that be really stupid, on the theory
TS> that if the people writing the tests found it so hard to use
TS> IPC::Shareable correctly, I'm probably not going to do any better, and
TS> so the tests are in fact indicative of problems I'm likely to encounter
TS> in my application if I foolishly go ahead and install and use
TS> IPC::Shareable?
I use IPC::ShareLite myself, and I like it better. Generally speaking,
though, you should be OK just using IPC::Shareable.
Ted
------------------------------
Date: Tue, 27 May 2008 11:15:51 -0500
From: Ted Zlatanov <tzz@lifelogs.com>
Subject: Re: Parsing
Message-Id: <86abiben9k.fsf@lifelogs.com>
On Mon, 26 May 2008 19:25:35 -0700 (PDT) "K.J. 44" <Holleran.Kevin@gmail.com> wrote:
KJ4> On May 26, 9:32 pm, Gunnar Hjalmarsson <nore...@gunnar.cc> wrote:
>> KDawg44 wrote:
>> > I am writing a top-down parser in Perl for a simple grammar. I would
>> > like to split on a change in a character set. Is there a way to split
>> > the tokens based on a change of a character set (like changing from a /
>> > \w+/ to /+/ or something like that.
>>
>> > Basically I want to be able to split var = var1 + var 2; into tokens
>> > (var, =, var1, +, var2, ;). I could do this with split / / but I
>> > would also like var=var1+var2; to split into the same tokens.
>>
>> > How can I parse these two and get the same thing?
>>
>> my @tokens = split /\s*([-+=;])\s*/, $string;
>>
>> --
>> Gunnar Hjalmarsson
>> Email:http://www.gunnar.cc/cgi-bin/contact.pl
KJ4> Thanks very much! That got me going in the right direction.
Take a look at Parse::RecDescent (especially if you don't need very fast
parsing). It comes with examples for what you're describing.
Hard-coding the lexing and parsing steps as others have shown you is
probably not what you want for anything but the simplest grammar.
Ted
------------------------------
Date: Tue, 27 May 2008 01:33:51 -0700 (PDT)
From: rthangam <ramesh.thangamani@gmail.com>
Subject: Re: Perldoc recommendation
Message-Id: <dab65c84-4561-424a-bc32-2774773dcce7@p39g2000prm.googlegroups.com>
On May 27, 9:47 am, "szr" <sz...@szromanMO.comVE> wrote:
> J=FCrgen Exner wrote:
> > 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:
>
> IMHO, it's the Microsoft product, Windows Vista, that insults many a
> people's intelligence. It is an utterly broken OS in many ways, aimed at
> controlling what and how you do certain things on your own system, which
> to me is just unacceptable.
>
> --
> szr
There is one at link http://perldoc.perl.org/. It is for perl 5.10.0
------------------------------
Date: Tue, 27 May 2008 01:31:21 -0700 (PDT)
From: Keenlearner <yingun@gmail.com>
Subject: Re: reinstall perl
Message-Id: <ec748dc3-db87-4c4f-8807-e017e134e5bd@w4g2000prd.googlegroups.com>
It appear to be a bug of Perl
http://bugs.openembedded.org/show_bug.cgi?id=2035
http://www.nntp.perl.org/group/perl.perl5.porters/2008/02/msg133863.html
PS. Slowly slowy I climb, although I was thrown with rocks and people
ignore me while I am climbing because of a mistake that I made which
could not be forgiven by them, at time it is so daunting. But with
persistent and perseverance, I manage to reach the top of the
mountain. A thousand miles begins with a single step.
Sorry and thanks
WIlliam
------------------------------
Date: Tue, 27 May 2008 08:36:58 -0700
From: "szr" <szrRE@szromanMO.comVE>
Subject: Re: reinstall perl
Message-Id: <g1h9qq0q26@news4.newsguy.com>
Keenlearner wrote:
> It appear to be a bug of Perl
>
> http://bugs.openembedded.org/show_bug.cgi?id=2035
>
> http://www.nntp.perl.org/group/perl.perl5.porters/2008/02/msg133863.html
>
> PS. Slowly slowy I climb, although I was thrown with rocks and people
> ignore me while I am climbing because of a mistake that I made which
> could not be forgiven by them
I didn't really make a mistake. Some people like to make way too much
hype about such trivial matters. Like I said, there has never really
been any taboo against posting in multiple completely separate venues
that are on the same subject, though it is customary to, if you receive
a useful answer in venue "A", to share that answer in "B", "C", etc.
Again, I compare this to cross posting in venues (like Usenet) that have
such a facility. Many people would see not sharing an answer as rude,
not the multiple posting itself, though there are some that have yet to
distinguish between personal opinions and guidelines all should adhere
to.
--
szr
------------------------------
Date: 27 May 2008 07:26:56 GMT
From: Abigail <abigail@abigail.be>
Subject: Re: Why reading the FAQs is good (example)
Message-Id: <slrng3ndtv.2nh.abigail@alexandra.abigail.be>
_
Ben Morrow (ben@morrow.me.uk) wrote on VCCCLXXXII September MCMXCIII in
<URL:news:ivtqg5-ej6.ln1@osiris.mauzo.dyndns.org>:
~~
~~ Quoth Marc Bissonnette <dragnet\_@_/internalysis.com>:
~~ >
~~ > Yep, I always do the search from the CPAN command line before the
~~ > installation. While I know there are all lower-case modules out there, I
~~ > don't think I've ever installed one (odd point, but...)
~~
~~ Modules with names in all-lowercase are pragmata: they affect the way
~~ perl parses your program. The only ones that are usually used are the
~~ ones that come with perl: strict, warnings, open, encoding, &c. There
~~ are some pragmata on CPAN, but they are generally rather advanced
~~ modules that interact with the perl core in subtle and complicated ways.
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
it know what a "pragma" is. Nor does everyone agree what a pragma is,
for instance, you say a pragma affects the way perl parses your program,
yet you mention warnings and strict as a pragmata. However, "use warnings"
doesn't affect how Perl parses my program, and the only way "use strict"
affects how Perl parses my program is that it will sometimes refuse to
parse my program. OTOH, "use Switch" and a lot of other source filters
do affect how my program is parsed, yet many source filters aren't
lowercased, and usually not called "pragmata".
I tend to call modules that fiddle with $^H or %^H pragmata.
Abigail
--
sub _'_{$_'_=~s/$a/$_/}map{$$_=$Z++}Y,a..z,A..X;*{($_::_=sprintf+q=%X==>"$A$Y".
"$b$r$T$u")=~s~0~O~g;map+_::_,U=>T=>L=>$Z;$_::_}=*_;sub _{print+/.*::(.*)/s};;;
*_'_=*{chr($b*$e)};*__=*{chr(1<<$e)}; # Perl 5.6.0 broke this...
_::_(r(e(k(c(a(H(__(l(r(e(P(__(r(e(h(t(o(n(a(__(t(us(J())))))))))))))))))))))))
------------------------------
Date: Tue, 27 May 2008 08:40:28 -0700
From: "szr" <szrRE@szromanMO.comVE>
Subject: Re: Why reading the FAQs is good (example)
Message-Id: <g1ha1d0q9h@news4.newsguy.com>
Abigail wrote:
> _
> Ben Morrow (ben@morrow.me.uk) wrote on VCCCLXXXII September MCMXCIII
> in <URL:news:ivtqg5-ej6.ln1@osiris.mauzo.dyndns.org>:
> ~~
> ~~ Quoth Marc Bissonnette <dragnet\_@_/internalysis.com>:
> ~~ >
> ~~ > Yep, I always do the search from the CPAN command line before the
> ~~ > installation. While I know there are all lower-case modules out
> there, I ~~ > don't think I've ever installed one (odd point, but...)
> ~~
> ~~ Modules with names in all-lowercase are pragmata: they affect the
> way ~~ perl parses your program. The only ones that are usually used
> are the ~~ ones that come with perl: strict, warnings, open,
> encoding, &c. There ~~ are some pragmata on CPAN, but they are
> generally rather advanced ~~ modules that interact with the perl
> core in subtle and complicated ways.
>
>
> 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
Doesn't "care" where? In the 'use' statement, it most certainly does
matter. And if you install every module as lowercase, you're definitely
going to have problems running someone else's code that uses the correct
casing. Saying Perl doesn't care about casing is misleading at best. In
general, casing in Perl matters very much.
--
szr
------------------------------
Date: Tue, 27 May 2008 16:38:23 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Why reading the FAQs is good (example)
Message-Id: <x7ej7nbt34.fsf@mail.sysarch.com>
>>>>> "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. 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
names.
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: Tue, 27 May 2008 08:57:13 -0700 (PDT)
From: Slickuser <slick.users@gmail.com>
Subject: Win32 OLE Excel existing
Message-Id: <9b9f10b4-fc88-4964-8a42-31b6cc3d8690@a1g2000hsb.googlegroups.com>
Is there a way to check if Excel exist beside checking the full path
of Excel or use use Win32::OLE::Const 'Microsoft Excel'?
Also, is there a way to tell which Excel they are using such as Office
2003 (11) or Office 2007 (12)?
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 1582
***************************************