[29058] in Perl-Users-Digest
Perl-Users Digest, Issue: 302 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Apr 4 14:10:08 2007
Date: Wed, 4 Apr 2007 11:09:07 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Wed, 4 Apr 2007 Volume: 11 Number: 302
Today's topics:
Re: Can't change filenames..why? <bik.mido@tiscalinet.it>
Re: Can't change filenames..why? <bik.mido@tiscalinet.it>
Re: Can't change filenames..why? <bik.mido@tiscalinet.it>
Re: Can't change filenames..why? <bik.mido@tiscalinet.it>
Re: Can't change filenames..why? <edMbj@aes-intl.com>
Re: Can't change filenames..why? <uri@stemsystems.com>
Re: Can't change filenames..why? <bik.mido@tiscalinet.it>
Re: extending a module? <bik.mido@tiscalinet.it>
Generating serial numbers <scobloke2@infotop.co.uk>
Re: Generating serial numbers <jurgenex@hotmail.com>
Re: Generating serial numbers usenet@DavidFilmer.com
Re: Generating serial numbers <nobull67@gmail.com>
Re: Generating serial numbers <tzz@lifelogs.com>
Re: Generating serial numbers (Randal L. Schwartz)
Re: Generating serial numbers <nobull67@gmail.com>
Re: Generating serial numbers krakle@visto.com
Re: How to resolve funky sync issues with fork here. xhoster@gmail.com
Re: How to turn off "Caps Lock" from Perl script. <bik.mido@tiscalinet.it>
Re: How to turn off "Caps Lock" from Perl script. <damercer@comcast.net>
Re: How to turn off "Caps Lock" from Perl script. <uri@stemsystems.com>
Re: More controlled Module loading - Faking output from <bik.mido@tiscalinet.it>
Re: More controlled Module loading - Faking output from <stumo@stumo.org.uk>
OT: How to turn off "Caps Lock" from Perl script. <jurgenex@hotmail.com>
Problem installing Errno <joliver@john-oliver.net>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 04 Apr 2007 17:14:30 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Can't change filenames..why?
Message-Id: <23g713179k5gtenoaomaihnrr5tc2kksio@4ax.com>
On Tue, 03 Apr 2007 21:35:26 -0700, Ed Jay <edMbj@aes-intl.com> wrote:
>>Interesting you are able to run a script which will not compile.
>
>Thanks for the diplomacy. An asshole would have accused me of lying.
It feels strange, but I have to agree with her^Wit. Post code that at
least compiles, unless the problem is that it doesn't compile, but
that doesn't seem to be the case. In *any* case, if the whole code is
too much, then prepare a minimal example still exhibiting the problem
and help peoplem to help you.
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: Wed, 04 Apr 2007 17:17:24 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Can't change filenames..why?
Message-Id: <3ag713t429qde306nqaha7hqbk4l682l4s@4ax.com>
On Tue, 03 Apr 2007 22:01:27 -0700, Ed Jay <edMbj@aes-intl.com> wrote:
>>We cannot help you if you lie to us.
>
>You need to learn some table manners.
You too. Actually it's quite funny that you say that, when you are
rude enough not to help people to help you!
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: Wed, 04 Apr 2007 17:19:27 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Can't change filenames..why?
Message-Id: <heg713t7p4ad77e1df2eg0q3v36agq0aue@4ax.com>
On Wed, 04 Apr 2007 01:36:52 -0400, Uri Guttman <uri@stemsystems.com>
wrote:
>and get perl on your own box and test it there. relying on uploading to
>test perl is like using stilts to ice skate.
$quote->tosig(); # nice analogy uri!
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: Wed, 04 Apr 2007 17:22:05 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Can't change filenames..why?
Message-Id: <0kg71355ur0lsujdgmb3g65npi4cudp8h9@4ax.com>
On Tue, 03 Apr 2007 23:18:15 -0700, Ed Jay <edMbj@aes-intl.com> wrote:
>> >> We cannot help you if you lie to us.
>>
>> EJ> You need to learn some table manners.
>>
>>ever watch house on tv. as he says everyone lies. simple fact of life.
>>
>>and if you think getting a tough but correct answer from tad is worse
>>than a polite but stupid answer from moronzilla (also know as
>>gurlknowsnoperl) then you have a lot to learn.
>
>A tough answer that includes name calling isn't a tough answer. It's an
>inappropriate and offensive response.
(Just for curiosity) the actual name calling being?!?
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: Wed, 04 Apr 2007 08:32:31 -0700
From: Ed Jay <edMbj@aes-intl.com>
Subject: Re: Can't change filenames..why?
Message-Id: <ppg7139lj9jj2mn7eu4l1p59n7k6bt30kg@4ax.com>
Uri Guttman scribed:
>>>>>> "EJ" == Ed Jay <edMbj@aes-intl.com> writes:
>
> EJ> Uri Guttman scribed:
> >>>>>>> "EJ" == Ed Jay <edMbj@aes-intl.com> writes:
> >>
> EJ> Tad McClellan scribed:
> >> >>
> >> >>> The original files upload fine. Everything seems to work.
> >> >>
> >> >> We cannot help you if you lie to us.
> >>
> EJ> You need to learn some table manners.
> >>
> >> ever watch house on tv. as he says everyone lies. simple fact of life.
> >>
> >> and if you think getting a tough but correct answer from tad is worse
> >> than a polite but stupid answer from moronzilla (also know as
> >> gurlknowsnoperl) then you have a lot to learn.
>
> EJ> A tough answer that includes name calling isn't a tough answer. It's an
> EJ> inappropriate and offensive response.
>
>he didn't call you a name. he stated something you did. big
>difference. he said you lied in your post (which you did as your code
>did NOT compile as posted) but he didn't call you a liar. now i could
>call you a whiner but i will just say you are whining too much.
>
> >> and get perl on your own box and test it there. relying on uploading to
> >> test perl is like using stilts to ice skate.
> >>
> EJ> I have Perl installed. As I mentioned to another, my warnings did not hint
> EJ> at the real problem, as did hers.
>
>hers?? ignore moronzilla. if you listen to its advice you do so at your
>own peril. your perl will be much worse for your efforts. if you want,
>google for its posting history
>
>and you kept saying tested when uploaded. you never said (lying by
>omission) tested locally. and warnings weren't the original complaint
>about your post - it was not even compiling. so get your story straight
>and tell it completely as the guidelines (mostly written and maintained
>by the aformentioned tad!) so helpfully tell you to.
>
I really don't want to perpetuate this thread, as it's become an absurd
castigation. That said, my original post said that if I deleted the renaming
function, the script uploaded files the way it should. That it doesn't
compile using 'strict' is something entirely different than the script won't
work as written.
Anyway...thanks everyone for the hints and direction. I appreciate
_everyone's_ comments, and again, I apologize for the sloppy presentation.
--
Ed Jay (remove 'M' to respond by email)
------------------------------
Date: Wed, 04 Apr 2007 11:51:17 -0400
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Can't change filenames..why?
Message-Id: <x7wt0si1e2.fsf@mail.sysarch.com>
>>>>> "EJ" == Ed Jay <edMbj@aes-intl.com> writes:
EJ> I really don't want to perpetuate this thread, as it's become an
EJ> absurd castigation. That said, my original post said that if I
EJ> deleted the renaming function, the script uploaded files the way
EJ> it should. That it doesn't compile using 'strict' is something
EJ> entirely different than the script won't work as written.
no, it is not a castigation but intended to be a teaching lesson to
you. if you take it the wrong way, that is your issue, not ours.
the fact that your code didn't compile under strict is very important
and you should also learn that. we get too many problems here which
would be quickly solved if they were using strict and warnings.
EJ> Anyway...thanks everyone for the hints and direction. I appreciate
EJ> _everyone's_ comments, and again, I apologize for the sloppy
EJ> presentation.
and let's see in the future if you actually learned from this
experience.
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
------------------------------
Date: Wed, 04 Apr 2007 17:58:10 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Can't change filenames..why?
Message-Id: <0li713p6nu78hc5dqoh4f86kur7n2odeit@4ax.com>
On Wed, 04 Apr 2007 08:32:31 -0700, Ed Jay <edMbj@aes-intl.com> wrote:
>function, the script uploaded files the way it should. That it doesn't
>compile using 'strict' is something entirely different than the script won't
>work as written.
The code you posted had syntax errors that would prevent it from
compiling under strict or not, under any exist{ed,ing} perl version.
That's *evidence*!!
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: Wed, 04 Apr 2007 17:09:42 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: extending a module?
Message-Id: <isf7131jv2jii6lpisd86900tccofpgvc2@4ax.com>
On 4 Apr 2007 12:21:56 GMT, anno4000@radom.zrz.tu-berlin.de wrote:
>> Great - that works nicely in separate files, but when I tried
>> to do it with an "infile" package it failed.
>
>[snippage]
>
>> I tried adding a "import BB;" after the "package main;"
>> but it made no difference.
>
>You're on the right track. Make that a method call, and make sure it
>happens at compile time (untested).
>
> BEGIN { BB->import }
Alternatively he may use my beloved code-in-@INC feature as a trick...
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: Wed, 04 Apr 2007 17:24:05 +0100
From: Ian Wilson <scobloke2@infotop.co.uk>
Subject: Generating serial numbers
Message-Id: <4613d129$0$21849$db0fefd9@news.zen.co.uk>
I have a Perl CGI application that handles transactions, writing data to
a temporary file. I need to keep the data files for a few weeks and so
need to allocate unique names to them.
1) I'm currently using the Process-ID but this wraps around rather
quickly and means filenames get reused on an essentialy unpredictable
basis. I got one collision in only 143 transactions.
2) Another method would be timestamps, but I'd probably need to
distinguish between transactions that arrive a few tens of milliseconds
apart. So the timestamp would be quite long (YYYYMMDDhhmmss.sss).
3) I have pondered keeping a "next available serial number" in a file
and using file locking to ensure a serial number is only used once
before the stored value is incremented. However I am vaguely aware that
it is not always trivial to write code that prevents race-conditions and
deadlocks. Maybe this is a wheel I shouldn't reinvent?
Apologies to anyone who feels this isn't really a Perl question. I have
looked at perldoc, google and cpan. Maybe I'm using the wrong keywords?
Any pointers, tips or suggestions? Especially for 3.
------------------------------
Date: Wed, 04 Apr 2007 16:30:24 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Generating serial numbers
Message-Id: <AoQQh.1699$yL1.1620@trndny04>
Ian Wilson wrote:
> I have a Perl CGI application that handles transactions, writing data
> to a temporary file. I need to keep the data files for a few weeks
> and so need to allocate unique names to them.
>
> 1) I'm currently using the Process-ID but this wraps around rather
> quickly and means filenames get reused on an essentialy unpredictable
> basis. I got one collision in only 143 transactions.
>
> 2) Another method would be timestamps, but I'd probably need to
> distinguish between transactions that arrive a few tens of
> milliseconds apart. So the timestamp would be quite long
> (YYYYMMDDhhmmss.sss).
Very simple approach: time stamp (seconds since epoch) combined with the
process ID.
The probabiliy of the same process ID being issued to a second process
during the same second is very remote.
jue
------------------------------
Date: 4 Apr 2007 10:11:01 -0700
From: usenet@DavidFilmer.com
Subject: Re: Generating serial numbers
Message-Id: <1175706660.892243.198800@p77g2000hsh.googlegroups.com>
On Apr 4, 9:24 am, Ian Wilson <scoblo...@infotop.co.uk> wrote:
> I need to keep the data files for a few weeks and so
> need to allocate unique names to them.
...
> 2) Another method would be timestamps, but I'd probably need to
> distinguish between transactions that arrive a few tens of milliseconds
> apart. So the timestamp would be quite long (YYYYMMDDhhmmss.sss).
If, indeed, you have a retention requirement of "only" a few weeks
then your timestamp format is unnecessairly descriptive. At the very
least, you could simply drop the YYYY.
Or you could work with "epoch time" (seconds past midnight Jan 1 1970
GMT, as returned by the time() function). But that's more descriptive
than you need; it's a ten-digit (decimal) value, but the last seven
digits are sufficient to distinguish 115 days. If you use an unsigned
hex representation instead, you can represent 194 days using only six
characters, and if you're willing to work with a higher numeric base
(such as base64, as made simple with the Math::BaseCnv module that Uri
told me about) then you can distinguish 194 days with only four
characters.
You don't need a decimal point to separate the sss from the rest of
the datestamp, so you save a byte by getting rid of that. If you use
base64 representation also for the milliseconds then you need only two
bytes (capable of representing 4096 values). So six bytes gets you a
base64 timestamp which is guaranteed to be unique over a 194-day (27
week) interval.
--
The best way to get a good answer is to ask a good question.
David Filmer (http://DavidFilmer.com)
------------------------------
Date: 4 Apr 2007 10:59:12 -0700
From: "Brian McCauley" <nobull67@gmail.com>
Subject: Re: Generating serial numbers
Message-Id: <1175709552.110099.302090@l77g2000hsb.googlegroups.com>
On Apr 4, 5:24 pm, Ian Wilson <scoblo...@infotop.co.uk> wrote:
> I have a Perl CGI application that handles transactions, writing data to
> a temporary file. I need to keep the data files for a few weeks and so
> need to allocate unique names to them.
>
> 1) I'm currently using the Process-ID but this wraps around rather
> quickly and means filenames get reused on an essentialy unpredictable
> basis. I got one collision in only 143 transactions.
>
> 2) Another method would be timestamps, but I'd probably need to
> distinguish between transactions that arrive a few tens of milliseconds
> apart. So the timestamp would be quite long (YYYYMMDDhhmmss.sss).
>
> 3) I have pondered keeping a "next available serial number" in a file
> and using file locking to ensure a serial number is only used once
> before the stored value is incremented. However I am vaguely aware that
> it is not always trivial to write code that prevents race-conditions and
> deadlocks. Maybe this is a wheel I shouldn't reinvent?
>
> Apologies to anyone who feels this isn't really a Perl question. I have
> looked at perldoc, google and cpan. Maybe I'm using the wrong keywords?
>
> Any pointers, tips or suggestions? Especially for 3.
------------------------------
Date: Wed, 04 Apr 2007 14:01:47 -0400
From: Ted Zlatanov <tzz@lifelogs.com>
Subject: Re: Generating serial numbers
Message-Id: <m2648c10j8.fsf@lifelogs.com>
On Wed, 04 Apr 2007 17:24:05 +0100 Ian Wilson <scobloke2@infotop.co.uk> wrote:
IW> I have a Perl CGI application that handles transactions, writing data
IW> to a temporary file. I need to keep the data files for a few weeks and
IW> so need to allocate unique names to them.
Use logrotate, multilog, or any of the bazillion solutions designed
for this. Trying to write it yourself is, as you've discovered,
unnecessarily painful. You want to google for "log rotation."
multilog in particular is very nice. Every line is tagged with a
precise timestamp automatically. qmail uses it, but it works fine on
its own.
I hope that's helpful.
Ted
------------------------------
Date: Wed, 04 Apr 2007 10:46:34 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Generating serial numbers
Message-Id: <86vegc3udh.fsf@blue.stonehenge.com>
>>>>> "Ian" == Ian Wilson <scobloke2@infotop.co.uk> writes:
Ian> I have a Perl CGI application that handles transactions, writing data to a
Ian> temporary file. I need to keep the data files for a few weeks and so need to
Ian> allocate unique names to them.
If you don't mind something really really long and ugly, see Data::UUID.
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
--
Posted via a free Usenet account from http://www.teranews.com
------------------------------
Date: 4 Apr 2007 11:04:57 -0700
From: "Brian McCauley" <nobull67@gmail.com>
Subject: Re: Generating serial numbers
Message-Id: <1175709897.847968.216630@b75g2000hsg.googlegroups.com>
On Apr 4, 6:59 pm, "Brian McCauley" <nobul...@gmail.com> wrote nothing
new:
[ oops ]
> On Apr 4, 5:24 pm, Ian Wilson <scoblo...@infotop.co.uk> wrote:
>
> > I have a Perl CGI application that handles transactions, writing data to
> > a temporary file. I need to keep the data files for a few weeks and so
> > need to allocate unique names to them.
>
> > 1) I'm currently using the Process-ID but this wraps around rather
> > quickly and means filenames get reused on an essentialy unpredictable
> > basis. I got one collision in only 143 transactions.
>
> > 2) Another method would be timestamps, but I'd probably need to
> > distinguish between transactions that arrive a few tens of milliseconds
> > apart. So the timestamp would be quite long (YYYYMMDDhhmmss.sss).
>
> > 3) I have pondered keeping a "next available serial number" in a file
> > and using file locking to ensure a serial number is only used once
> > before the stored value is incremented. However I am vaguely aware that
> > it is not always trivial to write code that prevents race-conditions and
> > deadlocks. Maybe this is a wheel I shouldn't reinvent?
You can go to the CPAN wheel store.
File::CounterFile
------------------------------
Date: 4 Apr 2007 11:08:39 -0700
From: krakle@visto.com
Subject: Re: Generating serial numbers
Message-Id: <1175710119.830486.114680@y66g2000hsf.googlegroups.com>
On Apr 4, 10:24 am, Ian Wilson <scoblo...@infotop.co.uk> wrote:
> I have a Perl CGI application that handles transactions, writing data to
> a temporary file. I need to keep the data files for a few weeks and so
> need to allocate unique names to them.
>
> 1) I'm currently using the Process-ID but this wraps around rather
> quickly and means filenames get reused on an essentialy unpredictable
> basis. I got one collision in only 143 transactions.
>
> 2) Another method would be timestamps, but I'd probably need to
> distinguish between transactions that arrive a few tens of milliseconds
> apart. So the timestamp would be quite long (YYYYMMDDhhmmss.sss).
>
> 3) I have pondered keeping a "next available serial number" in a file
> and using file locking to ensure a serial number is only used once
> before the stored value is incremented. However I am vaguely aware that
> it is not always trivial to write code that prevents race-conditions and
> deadlocks. Maybe this is a wheel I shouldn't reinvent?
>
> Apologies to anyone who feels this isn't really a Perl question. I have
> looked at perldoc, google and cpan. Maybe I'm using the wrong keywords?
>
> Any pointers, tips or suggestions? Especially for 3.
Think about it... You could do the Process ID + DateTime + Random
Number then encypt it with MD5.... Like so:
use Digest::MD5;
my $md5 = Digest::MD5->new;
my $rand = time.rand().$$;
$md5->add($rand);
my $serial = $md5->hexdigest;
The odds of there ever being a repeat are very very very slim.
------------------------------
Date: 04 Apr 2007 16:12:00 GMT
From: xhoster@gmail.com
Subject: Re: How to resolve funky sync issues with fork here.
Message-Id: <20070404121201.679$lG@newsreader.com>
"grocery_stocker" <cdalten@gmail.com> wrote:
>
> The lines:
> BEFORE FOR BRACKET
> ugh geeze blah test smith bob homes point
>
> Sometmes don't appear in sync. How would I get them in sync?
If you want to run things in sync, then don't fork. You seem to have a
X-Y problem here.
> Would I
> have to insert another wait() into the child? Just need some ideas
> here.
The child has nothing to "wait" for.
Xho
--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
------------------------------
Date: Wed, 04 Apr 2007 17:25:38 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: How to turn off "Caps Lock" from Perl script.
Message-Id: <log713hrsvciv68hvr8l7cimp5fgduj3eh@4ax.com>
On Wed, 4 Apr 2007 21:11:05 +1000, "Sisyphus"
<sisyphus1@nomail.afraid.org> wrote:
>However, acting on the judicious advice handed out on the perlmonks CB, I've
>just taken the hardware solution of prizing off the "Caps Lock" key and
>covering the hole with cellotape (to prevent foreign objects such as
>dandruff and breadcrumbs from getting into the guts of the keyboard).
Actually, judging from similar such discussions, I'm appearently the
only one to use it on purpose, although on a sparse basis. Oh, and
when I do, I *do* happen to forget it on, too, which is the problem
many people see in it. Whatever, I'm not removing it. No way!!
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: Wed, 4 Apr 2007 10:53:19 -0500
From: "Dan Mercer" <damercer@comcast.net>
Subject: Re: How to turn off "Caps Lock" from Perl script.
Message-Id: <2rKdnbN99IFsVI7bnZ2dnUVZ_h2pnZ2d@comcast.com>
"Jürgen Exner" <jurgenex@hotmail.com> wrote in message news:uKPQh.6181$iw5.5812@trndny06...
: Sisyphus wrote:
: > "katera" <katera@tovle.ct> wrote in message
: > news:euvlkg$bh0$1@ss408.t-com.hr...
: >> How to turn off "Caps Lock" from Perl script.
: >
: > This is a problem close to my heart. (I only ever hit the "Caps Lock"
: > by mistake ... well ... to be honest, I have occasionally
: > intentionally turned "Caps Lock" on when typing in product keys -
: > which always seem to use upper case alpha chars).
: >
: > A quick question to the perlmonks CB ascertained that (as far as was
: > known) there's no perl solution to the problem.
: >
: > There are, however, bound to be software solutions (depending upon
: > your OS). On Win32, PowerToy is apparently one such solution.
:
: If you are running Windows:
: - Control Panel
: - open Keyboard
: - open tab Key Settings
: - select "Caps Lock" and click "Edit"
: - check "Disable the CAPS LOCK key
:
On Windows ME you can reassign the CAPS LOCK key - I reassign to the
control key. On X11 you can use xmodmap and XKeyCaps is a nifty
GUI front end to xmodmap.
Dan Mercer
: Works for me on a MS wireless keyboard. Other keyboards that come with other
: drivers maybe don't have this option.
:
: Of course this has nothing to do with the original question or Perl any
: longer.
:
: jue
:
:
------------------------------
Date: Wed, 04 Apr 2007 12:03:40 -0400
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: How to turn off "Caps Lock" from Perl script.
Message-Id: <x7slbgi0tf.fsf@mail.sysarch.com>
>>>>> "MD" == Michele Dondi <bik.mido@tiscalinet.it> writes:
MD> On Wed, 4 Apr 2007 21:11:05 +1000, "Sisyphus"
MD> <sisyphus1@nomail.afraid.org> wrote:
>> However, acting on the judicious advice handed out on the perlmonks CB, I've
>> just taken the hardware solution of prizing off the "Caps Lock" key and
>> covering the hole with cellotape (to prevent foreign objects such as
>> dandruff and breadcrumbs from getting into the guts of the keyboard).
MD> Actually, judging from similar such discussions, I'm appearently the
MD> only one to use it on purpose, although on a sparse basis. Oh, and
MD> when I do, I *do* happen to forget it on, too, which is the problem
MD> many people see in it. Whatever, I'm not removing it. No way!!
anyone ever heard of xmodmap? easy way to redfine keys so capslock
becomes control like it was before ibm ruined the keyboard. know why
they did that? capslock was a useful key on manual typewriters since you
had to really push hard on shift to lift up the key carriage. when
electric typewriters came out they kept that evn though it wasn't hard
to push shift anymore (especially with the selectric golf ball where
keys were all electronic). so when ibm created the pc they wanted to
keep it just like the office typewriter to ease conversions. well, they
kept capslock but needed a control key so they put that in a lousy
place. now no one in their right mind needs capslock on a computer
(other than spammers or aolers). but it has remained there wasting space
which should rightfully be control. i swap capslock and control when i
can with xmodmap. and i use sun keyboards when i can which are much
better than any pc/mac keyboard and has control and escape where they
belong.
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
------------------------------
Date: Wed, 04 Apr 2007 17:29:39 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: More controlled Module loading - Faking output from caller
Message-Id: <avg713lh97ioqt7llbpviup0jnrs8kvs0i@4ax.com>
On 4 Apr 2007 05:06:06 -0700, "Stumo" <stumo@stumo.org.uk> wrote:
>I'm trying to write my own function that works like use but outputs a
>more user friendly error message if the module isn't present.
C<use> is not a *function*, but a *statement*, and one with a
semantics that may be surprising to the uninitiated: in fact it is
executed in a BEGIN block. Thus you *can't* write a function that
works like it, but you may create a source filter to that effect. Of
course I'm not recommending you to do so...
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: 4 Apr 2007 09:20:23 -0700
From: "Stumo" <stumo@stumo.org.uk>
Subject: Re: More controlled Module loading - Faking output from caller
Message-Id: <1175703623.360573.260030@b75g2000hsg.googlegroups.com>
On 4 Apr, 13:32, Sherm Pendley <spamt...@dot-app.org> wrote:
>
> Push() a reference to your function onto the end of @INC. It'll be called
> if the requested module isn't found in any of the previous entries.
>
Thanks all; This combined with Class::Inspector and goto has allowed
me to everything I needed.
------------------------------
Date: Wed, 04 Apr 2007 15:45:30 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: OT: How to turn off "Caps Lock" from Perl script.
Message-Id: <uKPQh.6181$iw5.5812@trndny06>
Sisyphus wrote:
> "katera" <katera@tovle.ct> wrote in message
> news:euvlkg$bh0$1@ss408.t-com.hr...
>> How to turn off "Caps Lock" from Perl script.
>
> This is a problem close to my heart. (I only ever hit the "Caps Lock"
> by mistake ... well ... to be honest, I have occasionally
> intentionally turned "Caps Lock" on when typing in product keys -
> which always seem to use upper case alpha chars).
>
> A quick question to the perlmonks CB ascertained that (as far as was
> known) there's no perl solution to the problem.
>
> There are, however, bound to be software solutions (depending upon
> your OS). On Win32, PowerToy is apparently one such solution.
If you are running Windows:
- Control Panel
- open Keyboard
- open tab Key Settings
- select "Caps Lock" and click "Edit"
- check "Disable the CAPS LOCK key
Works for me on a MS wireless keyboard. Other keyboards that come with other
drivers maybe don't have this option.
Of course this has nothing to do with the original question or Perl any
longer.
jue
------------------------------
Date: 04 Apr 2007 17:26:59 GMT
From: John Oliver <joliver@john-oliver.net>
Subject: Problem installing Errno
Message-Id: <slrnf17nv3.viq.joliver@ns.sdsitehosting.net>
It looks like it completes to me, but CPAN reports that it didn't, but
not why. A manual make and make install seem to work just fine.
cpan[1]> install Bundle::RT
CPAN: Storable loaded ok
Going to read /root/.cpan/Metadata
Database was generated on Tue, 03 Apr 2007 19:10:03 GMT
Digest::MD5 is up to date (2.36).
DBI is up to date (1.54).
Test::Inline is up to date (2.201).
Class::ReturnValue is up to date (0.53).
DBIx::SearchBuilder is up to date (1.48).
Text::Template is up to date (1.44).
File::Spec is up to date (3.24).
HTML::Entities is up to date (1.35).
HTML::Scrubber is up to date (0.08).
Net::Domain is up to date (2.19_01).
Log::Dispatch is up to date (2.17).
Locale::Maketext is up to date (1.10).
Locale::Maketext::Lexicon is up to date (0.62).
Locale::Maketext::Fuzzy is up to date (0.02).
MIME::Entity is up to date (5.420).
Mail::Mailer is up to date (1.74).
Net::SMTP is up to date (2.30).
Text::Wrapper is up to date (1.01).
Time::ParseDate is up to date (2006.0814).
Time::HiRes is up to date (1.9707).
File::Temp is up to date (0.18).
Term::ReadKey is up to date (2.30).
Text::Autoformat is up to date (1.13).
Text::Quoted is up to date (2.02).
Tree::Simple is up to date (1.17).
Scalar::Util is up to date (1.19).
Module::Versions::Report is up to date (1.02).
Cache::Simple::TimedExpiry is up to date (0.27).
UNIVERSAL::require is up to date (0.11).
Calendar::Simple is up to date (1.17).
Params::Validate is up to date (0.88).
Cache::Cache is up to date (1.05).
Exception::Class is up to date (1.23).
HTML::Mason is up to date (1.35).
MLDBM is up to date (2.01).
Running install for module Errno
Running make for G/GB/GBARR/Errno-1.10.tar.gz
CPAN: Digest::SHA loaded ok
CPAN: Compress::Zlib loaded ok
Checksum for /root/.cpan/sources/authors/id/G/GB/GBARR/Errno-1.10.tar.gz
ok
Scanning cache /root/.cpan/build for sizes
Errno-1.10/
Errno-1.10/Errno_pm.PL
Errno-1.10/d/
Errno-1.10/d/Errno.pm
Errno-1.10/MANIFEST
Errno-1.10/ChangeLog
Errno-1.10/t/
Errno-1.10/t/errno.t
Errno-1.10/Makefile.PL
Errno-1.10/README
Errno-1.10/SIGNATURE
Errno-1.10/META.yml
Removing previously used /root/.cpan/build/Errno-1.10
CPAN.pm: Going to build G/GB/GBARR/Errno-1.10.tar.gz
Checking if your kit is complete...
Looks good
Writing Makefile for Errno
CPAN: YAML loaded ok
/usr/bin/perl "-Iblib/arch" "-Iblib/lib" Errno_pm.PL Errno.pm
cp Errno.pm blib/lib/Errno.pm
Manifying blib/man3/Errno.3pm
/usr/bin/make -- OK
Running make test
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e"
"test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/errno....ok
All tests successful.
Files=1, Tests=139, 0 wallclock secs ( 0.01 cusr + 0.07 csys = 0.08
CPU)
/usr/bin/make test -- OK
Running make install
Manifying blib/man3/Errno.3pm
Writing
/usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/auto/Errno/.packlist
Appending installation info to
/usr/lib/perl5/5.8.5/i386-linux-thread-multi/perllocal.pod
/usr/bin/make install -- OK
FreezeThaw is up to date (0.43).
CGI::Cookie is up to date (1.28).
Storable is up to date (2.16).
Apache::Session is up to date (1.82).
XML::RSS is up to date (1.22).
HTTP::Server::Simple is up to date (0.27).
HTTP::Server::Simple::Mason is up to date (0.09).
GD is up to date (2.35).
GD::Graph is up to date (1.4308).
GD::Text is up to date (0.86).
Text::WikiFormat is up to date (0.78).
HTML::TreeBuilder is up to date (3.23).
HTML::FormatText is up to date (2.04).
Getopt::Long is up to date (2.36).
LWP::UserAgent is up to date (2.033).
Regexp::Common is up to date (2.120).
Test::Inline is up to date (2.201).
Apache::Test is up to date (1.29).
HTML::Form is up to date (1.054).
HTML::TokeParser is up to date (2.37).
WWW::Mechanize is up to date (1.22).
Test::WWW::Mechanize is up to date (1.12).
CGI is up to date (3.28).
Module::Refresh is up to date (0.09).
XML::Simple is up to date (2.16).
Bundle summary: The following items in bundle Bundle::RT had
installation
problems:
Errno
cpan[2]>
--
* John Oliver http://www.john-oliver.net/ *
------------------------------
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 302
**************************************