[24573] in Perl-Users-Digest
Perl-Users Digest, Issue: 6749 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jun 30 06:05:43 2004
Date: Wed, 30 Jun 2004 03:05: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 Wed, 30 Jun 2004 Volume: 10 Number: 6749
Today's topics:
catching ctrl chars (justme)
Re: catching ctrl chars <postmaster@castleamber.com>
Re: catching ctrl chars <abigail@abigail.nl>
Re: catching ctrl chars <spamtrap@dot-app.org>
Downloading form based web page <do.not.spam.me@work.com>
Re: Downloading form based web page <postmaster@castleamber.com>
Re: error logs... <postmaster@castleamber.com>
Re: error logs... <andre.wisniewski@gmx.de>
Re: error logs... <postmaster@castleamber.com>
Re: error logs... <andre.wisniewski@gmx.de>
Re: error logs... <postmaster@castleamber.com>
Re: grabbing array vlaues in a loop where array is rede <nobull@mail.com>
Re: How to use 2 DIFFERENT VERSIONS of the SAME MODULE <nobull@mail.com>
Re: Looking for a certain regexp <abigail@abigail.nl>
Re: Looking for a certain regexp <postmaster@castleamber.com>
Re: Looking for a certain regexp <spamtrap@dot-app.org>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 30 Jun 2004 00:41:49 -0700
From: eight02645999@yahoo.com (justme)
Subject: catching ctrl chars
Message-Id: <c0837966.0406292341.76b1d013@posting.google.com>
hi
how can i catch Ctrl-x (or any other letters except 'c' ) in perl ??
thanks..
------------------------------
Date: Wed, 30 Jun 2004 02:51:03 -0500
From: John Bokma <postmaster@castleamber.com>
Subject: Re: catching ctrl chars
Message-Id: <40e270e9$0$190$58c7af7e@news.kabelfoon.nl>
justme wrote:
> hi
>
> how can i catch Ctrl-x (or any other letters except 'c' ) in perl ??
> thanks..
catch from where? keyboard?
--
John MexIT: http://johnbokma.com/mexit/
personal page: http://johnbokma.com/
Experienced Perl programmer available: http://castleamber.com/
Happy Customers: http://castleamber.com/testimonials.html
------------------------------
Date: 30 Jun 2004 07:55:37 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: catching ctrl chars
Message-Id: <slrnce4sfp.llu.abigail@alexandra.abigail.nl>
justme (eight02645999@yahoo.com) wrote on MMMCMLVI September MCMXCIII in
<URL:news:c0837966.0406292341.76b1d013@posting.google.com>:
<> hi
<>
<> how can i catch Ctrl-x (or any other letters except 'c' ) in perl ??
<> thanks..
What do you mean by "catching" ctrl-x? Matching with a regex?
Abigail
--
perl -le 's[$,][join$,,(split$,,($!=85))[(q[0006143730380126152532042307].
q[41342211132019313505])=~m[..]g]]e and y[yIbp][HJkP] and print'
------------------------------
Date: Wed, 30 Jun 2004 04:03:02 -0400
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: catching ctrl chars
Message-Id: <vq6dnTaoKaYo7n_dRVn-gQ@adelphia.com>
justme wrote:
> how can i catch Ctrl-x (or any other letters except 'c' ) in perl ??
> thanks..
perldoc -q signal
sherm--
--
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org
------------------------------
Date: Wed, 30 Jun 2004 08:18:34 +0000 (UTC)
From: Takeshi <do.not.spam.me@work.com>
Subject: Downloading form based web page
Message-Id: <cbtt0q$7me$1@sparta.btinternet.com>
Hi,
I'm a Perl virgin (programmed in many languages though C/C++, Java). I
want to write a little script to download dynamic data generated by a
form based web page. By that, I mean, one has to select options
(actually one combo box item on the page) to have the data generated.
Currently, I do this manually, by having a timer app pop up a reminder
to save the data. I thought "there must be a better way to do this". I
googled and came accros wget but I don't think that can handle form
based web pages - it is simply good at sucking URLs. OK, the to get to
the point - anyone knows how I can write a little script that will allow
me to programatically select a combo box displayed on the page - and
then save the page ?
A little code snippet would be most useful as I am new to Perl
(alternatively, if some one has already written such a script or can
point me to the location of such a script, I'll be most grateful).
MTIA
------------------------------
Date: Wed, 30 Jun 2004 03:33:10 -0500
From: John Bokma <postmaster@castleamber.com>
Subject: Re: Downloading form based web page
Message-Id: <40e27ac7$1$207$58c7af7e@news.kabelfoon.nl>
Takeshi wrote:
> Hi,
>
> I'm a Perl virgin (programmed in many languages though C/C++, Java). I
> want to write a little script to download dynamic data generated by a
> form based web page. By that, I mean, one has to select options
> (actually one combo box item on the page) to have the data generated.
>
> Currently, I do this manually, by having a timer app pop up a reminder
> to save the data. I thought "there must be a better way to do this". I
> googled and came accros wget but I don't think that can handle form
> based web pages - it is simply good at sucking URLs. OK, the to get to
> the point - anyone knows how I can write a little script that will allow
> me to programatically select a combo box displayed on the page - and
> then save the page ?
If you know what is selected, you can call the CGI script directly using
a POST or GET, and parse the result. See http://johnbokma.com/perl/
for some small examples.
Have a peek at
<http://search.cpan.org/~petdance/WWW-Mechanize-1.02/lib/WWW/Mechanize.pm>
too.
--
John MexIT: http://johnbokma.com/mexit/
personal page: http://johnbokma.com/
Experienced Perl programmer available: http://castleamber.com/
Happy Customers: http://castleamber.com/testimonials.html
------------------------------
Date: Wed, 30 Jun 2004 00:16:03 -0500
From: John Bokma <postmaster@castleamber.com>
Subject: Re: error logs...
Message-Id: <40e24c96$0$861$58c7af7e@news.kabelfoon.nl>
bxb7668 wrote:
> Could all of you folks please take your non-Perl related dispute to
> another forum. You're wasting bandwidth for those of use that don't
> care. Thank you.
Kill threads.
--
John MexIT: http://johnbokma.com/mexit/
personal page: http://johnbokma.com/
Experienced Perl programmer available: http://castleamber.com/
Happy Customers: http://castleamber.com/testimonials.html
------------------------------
Date: Wed, 30 Jun 2004 07:36:39 +0200
From: "Andre Wisniewski" <andre.wisniewski@gmx.de>
Subject: Re: error logs...
Message-Id: <opsad67dh5udlqzq@ares>
On Wed, 30 Jun 2004 00:16:03 -0500, John Bokma
<postmaster@castleamber.com> wrote:
> bxb7668 wrote:
>
>> Could all of you folks please take your non-Perl related dispute to
>> another forum. You're wasting bandwidth for those of use that don't
>> care. Thank you.
>
> Kill threads.
>
What a hurrid discussion. Stop talking about Hitler, Gestapo and Nazis.
I'm sure you don't really know what they mean. You would not use
these words so frivolous otherwise.
Remember, this is a Perl Group.
Thanks in advance
--
Andre
---
Fighting for peace is like f..ing for virginity
------------------------------
Date: Wed, 30 Jun 2004 01:04:01 -0500
From: John Bokma <postmaster@castleamber.com>
Subject: Re: error logs...
Message-Id: <40e257d1$0$189$58c7af7e@news.kabelfoon.nl>
Andre Wisniewski wrote:
> On Wed, 30 Jun 2004 00:16:03 -0500, John Bokma
> <postmaster@castleamber.com> wrote:
>
>> bxb7668 wrote:
>>
>>> Could all of you folks please take your non-Perl related dispute to
>>> another forum. You're wasting bandwidth for those of use that don't
>>> care. Thank you.
>>
>> Kill threads.
>
> What a hurrid discussion. Stop talking about Hitler, Gestapo and Nazis.
You reply to my post, can you elaborate where I used those names?
> I'm sure you don't really know what they mean.
Since I am Dutch I am more than aware about those names.
> You would not use
> these words so frivolous otherwise.
>
> Remember, this is a Perl Group.
Remember, this is Usenet, it has some nice way to see who is writing
what, so you can react on the writing. It was lost at you :-(.
--
John MexIT: http://johnbokma.com/mexit/
personal page: http://johnbokma.com/
Experienced Perl programmer available: http://castleamber.com/
Happy Customers: http://castleamber.com/testimonials.html
------------------------------
Date: Wed, 30 Jun 2004 09:07:33 +0200
From: "Andre Wisniewski" <andre.wisniewski@gmx.de>
Subject: Re: error logs...
Message-Id: <opsaebevvkudlqzq@ares>
>
> You reply to my post, can you elaborate where I used those names?
>
Right, you didn't use these names. I did not send the reply correctly.
My mistake.
>
> Since I am Dutch I am more than aware about those names.
>
I am german.
>
> Remember, this is Usenet, it has some nice way to see who is writing
> what, so you can react on the writing. It was lost at you :-(.
>
See above. Sometimes my mouse behaves like a donkey. ;-)
--
Andre
---
Fighting for peace is like f..ing for virginity
------------------------------
Date: Wed, 30 Jun 2004 02:23:27 -0500
From: John Bokma <postmaster@castleamber.com>
Subject: Re: error logs...
Message-Id: <40e26a6f$0$210$58c7af7e@news.kabelfoon.nl>
Andre Wisniewski wrote:
>> You reply to my post, can you elaborate where I used those names?
>
> Right, you didn't use these names. I did not send the reply correctly.
> My mistake.
No problem. I was thinking "kill thread" was misleading, I ment, with
most readers you can kill entire threads. The headers are not that much
bandwidth.
--
John MexIT: http://johnbokma.com/mexit/
personal page: http://johnbokma.com/
Experienced Perl programmer available: http://castleamber.com/
Happy Customers: http://castleamber.com/testimonials.html
------------------------------
Date: 30 Jun 2004 09:36:11 +0100
From: Brian McCauley <nobull@mail.com>
Subject: Re: grabbing array vlaues in a loop where array is redefined
Message-Id: <u91xjxtpc4.fsf@wcl-l.bham.ac.uk>
Jaap Karssenberg <j.g.karssenberg@student.utwente.nl> writes:
> I think your problem is that you use refrences to @correct, these keep
> pointing to the _current_ values of @correct.
>
> Try:
> $corrects{$quest}=[@corrects];
>
> instead of:
> $corrects{$quest}=\@correct;
~10% of the time that's the right solution.
~90% of the time the problem only exists because you've given @correct
the wrong scope.
You should always declare all variables as lexically scoped in the
smallest applicable lexical scope unless you have a positive reason to
do otherwise. BTW: this is not perculliar to Perl, it applies in all
programming languges - allowing that a language not having lexical
variables is a positive reason :-).
For Perl this means that most of the time the declaration of scalars
should be combined with the first assignment. BTW: this to is not
perculliar to Perl, it also applies in other programming languges
where assignment and declaration can be combined.
By following this convention you will be able to get maximum beniefit
out of putting "use strict" at the top of all your scripts.
Try to get into this habit now, do not wait for your failure to do so
to cause you the unecessary distress of wasting your own time and that
of other people. (Oops, too late). The longer you leave it the harder
you will find it to adjust. Worse still, if you leave it too long you
may never adjust and may mutate into a bitter and twisted troll.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: 30 Jun 2004 09:26:17 +0100
From: Brian McCauley <nobull@mail.com>
Subject: Re: How to use 2 DIFFERENT VERSIONS of the SAME MODULE in the same perl program ?
Message-Id: <u96599tpsm.fsf@wcl-l.bham.ac.uk>
"Yves Petinot" <yxp118@psu.edu> writes:
> I have 2 versions of the same perl module. Now what that module
> exactly does is somewhat irrelevant to my question, but if u must know
> this module is a DBM module. Ok so you got it: i basically have a
> database in one format and i want to switch to the upgraded format.
> Unfortunately the module which handles that new format is the next
> version of the module that handles the old format ... talk of a
> headache !
I would fork() (or more likely open() with a mode of '-|' or '|-')
before I load either module then load one module in the parent and the
other in the child.
If a one-way FIFO communication between the two parts is not sufficient I'd
create a Safe comapartment (with unrestricted opmask).
There's also something called Safe::World which may help in this sort
of situation but I'm not sure.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: 30 Jun 2004 08:01:27 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: Looking for a certain regexp
Message-Id: <slrnce4sqn.llu.abigail@alexandra.abigail.nl>
Sherm Pendley (spamtrap@dot-app.org) wrote on MMMCMLVI September MCMXCIII
in <URL:news:pOmdnalP3o4Kv3_dRVn-tA@adelphia.com>:
`` Robert TV wrote:
``
`` > Hi, has onyone ever created a regexp to match common credit card formulas?
``
`` No, because it's not something you can check with a regexp, beyond the bare
`` minimum of verifying that it's 16 numeric characters, and (as you've found)
`` that the first character corresponds to one of the CC types you accept.
Checksums *can* be checked with a regexp. Regexes for certain credit cards
are on my todo list for Regexp::Common. Now, if only I could find the
URLs with the checksum formulas....
Abigail
--
perl -we '$_ = q ;4a75737420616e6f74686572205065726c204861636b65720as;;
for (s;s;s;s;s;s;s;s;s;s;s;s)
{s;(..)s?;qq qprint chr 0x$1 and \161 ssq;excess;}'
------------------------------
Date: Wed, 30 Jun 2004 03:07:06 -0500
From: John Bokma <postmaster@castleamber.com>
Subject: Re: Looking for a certain regexp
Message-Id: <40e274ab$0$874$58c7af7e@news.kabelfoon.nl>
Abigail wrote:
> Sherm Pendley (spamtrap@dot-app.org) wrote on MMMCMLVI September MCMXCIII
> in <URL:news:pOmdnalP3o4Kv3_dRVn-tA@adelphia.com>:
> `` Robert TV wrote:
> ``
> `` > Hi, has onyone ever created a regexp to match common credit card formulas?
> ``
> `` No, because it's not something you can check with a regexp, beyond the bare
> `` minimum of verifying that it's 16 numeric characters, and (as you've found)
> `` that the first character corresponds to one of the CC types you accept.
>
> Checksums *can* be checked with a regexp. Regexes for certain credit cards
> are on my todo list for Regexp::Common. Now, if only I could find the
> URLs with the checksum formulas....
http://www.webopedia.com/TERM/L/Luhn_formula.html
<http://www.google.com/search?q=credit+card+check+formula>
--
John MexIT: http://johnbokma.com/mexit/
personal page: http://johnbokma.com/
Experienced Perl programmer available: http://castleamber.com/
Happy Customers: http://castleamber.com/testimonials.html
------------------------------
Date: Wed, 30 Jun 2004 05:23:12 -0400
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: Looking for a certain regexp
Message-Id: <sKqdnX-G5uocG3_dRVn-vA@adelphia.com>
Abigail wrote:
> Checksums *can* be checked with a regexp.
Didn't know that, thanks.
> Regexes for certain credit cards are on my todo list for Regexp::Common.
> Now, if only I could find the URLs with the checksum formulas....
In addition to the links John provided, you could have a look at the code in
Business::CreditCard. Dunno if it uses regexes or not.
sherm--
--
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org
------------------------------
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 V10 Issue 6749
***************************************