[23043] in Perl-Users-Digest
Perl-Users Digest, Issue: 5264 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jul 24 00:11:16 2003
Date: Wed, 23 Jul 2003 21:10:13 -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, 23 Jul 2003 Volume: 10 Number: 5264
Today's topics:
Re: Larry W... out of work ?? Impossible... or... <stevea@wrq.com>
Re: Larry W... out of work ?? Impossible... or... (stu7)
Re: Larry W... out of work ?? Impossible... or... (stu7)
Re: Larry W... out of work ?? Impossible... or... <asu1@c-o-r-n-e-l-l.edu>
Re: Larry W... out of work ?? Impossible... or... (stu7)
Re: Larry W... out of work ?? Impossible... or... (stu7)
Re: Larry W... out of work ?? Impossible... or... <REMOVEsdnCAPS@comcast.net>
Re: Larry W... out of work ?? Impossible... or... <aa@ukrecscuba.org.uk>
Re: Larry W... out of work ?? Impossible... or... <jurgenex@hotmail.com>
Re: priority queue <pkent77tea@yahoo.com.tea>
Re: Problem with IE and Cookie <chad@vellum.demon.co.uk>
Re: Q- Empirical usable upper limit on hash array numbe <tzz@lifelogs.com>
Re: Regex help (? as delimiter) <pinyaj@rpi.edu>
Re: Regex help (? as delimiter) <pinyaj@rpi.edu>
request for perl TK Example (Go Perl)
Re: request for perl TK Example (John Porter)
Re: request for perl TK Example <bwalton@rochester.rr.com>
Re: Retrieving Data from Microsoft Access Database usin <bart.lateur@pandora.be>
Re: Soap::Lite and hashes <aa@ukrecscuba.org.uk>
Style question regarding subroutines and lexical variab <jandellis@hotmail.com>
Re: Style question regarding subroutines and lexical va <asu1@c-o-r-n-e-l-l.edu>
Re: <bwalton@rochester.rr.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 23 Jul 2003 21:21:36 GMT
From: Steve Allan <stevea@wrq.com>
Subject: Re: Larry W... out of work ?? Impossible... or...
Message-Id: <uu19d0win.fsf@wrq.com>
"Eric J. Roode" <REMOVEsdnCAPS@comcast.net> writes:
<snip appropriate edification>
>Let me suggest a counter-analogy. Suppose you're walking down a sidewalk
>in a neighborhood you're familiar with. A car pulls up with the radio
>blaring and honks repeatedly at you. When you go over to see what his
>problem is, he says, "Hey, I need to get to 4th and Broad. Tell me how
>to get there. Now come on, make it snappy!" And then he tosses a
>cigarette butt out of his car at your feet.
>
>Maybe you'll help him, maybe you won't. Nobody would blame you for not
>helping him and just walking away. But then suppose you said to him, "You
>know, people would be more likely to help you get places if you would
>turn down your radio and not honk at them, and to say words like
>'please' and 'thank you'". And then this driver went ballistic, ripping
>into you, calling you childish and saying "You don't own this street!
>Who do you think you are? I'll honk my horn any time I want -- at 3am if
>I feel like it!"
>
>Well, how would you feel about a driver who so thoroughly ignored social
>conventions like that?
Now *that* is what I call a great analogy! I hope this finds its way
into the posting guidelines.
--
-- Steve
------------------------------
Date: 23 Jul 2003 18:25:50 -0700
From: stuseven@hotmail.com (stu7)
Subject: Re: Larry W... out of work ?? Impossible... or...
Message-Id: <d7dd90b0.0307231725.ca90aff@posting.google.com>
*** My original post, included below, was both
*** sincere and accurate... in my estimation, the
*** problem addressed will not change without serious
*** improvements in the way Perl is either presented
*** or supported.
***
*** The fact that "Sinan Unar","Keith Keller",
*** "Martien Verbruggen", "Eric Roode", or "Gregory
*** Toomey", all got together to harass me, and belittle
*** my well meant post, should be taken as a positive
*** affirmation of what I was saying... this is how
*** these people spend their time - trying to uphold
*** their private fantasy of importance as "newsgroup
*** workers", and aimlessly criticizing those who come
*** to the groups looking for help, or otherwise fail
*** to offer proper adoration of their sick little
*** cabal of deadbeat style whines. Nothing useful
*** or factual was offered by any of these problem posters_
*** but then, thats an assumption.
*** I was a little surprised to see anyone named
*** randal schwartz jump on this teetering bandwagon
*** of jeering spammers... isnt he supposed to be one of
*** the good guys ?
stuseven@hotmail.com (stu7) wrote in message news:<d7dd90b0.0307211916.2feb9d1b@posting.google.com>...
> +
> Larry W... out of work ?? Impossible... or...
> ...or is it ?
>
> Lets look at what are likely the top reasons his book
> company would have laid Larry off... well, first things
> first... book sales down... but why ? Isn't PERL the most
> popular thing to come around since email ? Sure... but,
> who is it popular with ?
>
> I first saw Perl the day it was released... I was IRCing
> and somebody came around announcing this new thing, Perl, so
> I checked it out... I forget what it offered at that time.
> Since then, of course, Perl has grown immensely, and to
> anyone willing to look, it is obvious that Perl now offers
> an excellent programming framework, and endless specialized
> support modules - Perl has, in addition, become a world effort...
> but, to a commercial venture - a book publisher, for instance,
> Perl is a gooey spit-out... it's a top grade product, with the
> unfortunate reputation of being an internet no-no... why ?
> Perl is NOT a professional offering... trying to make it
> on a commercial level... there simply are no official
> repesentatives of Perl - to anyone looking for help, we either
> "buy a book", or, more often, [consult an internet Perl user
> group]... this is where the goo gets sticky.
> I would guess there aren't one-in-twenty prospective perl
> users, who, after consulting one of the "internet Perl sources",
> has had the positive response they expected, or even remains
> very interested in using or learning Perl thereafter... goodbye
> Perl reputation... Perl, suddenly, doesn't have any commercial
> viability, when all it means is getting berated by a group of
> self-styled technique experts, "discussion leaders", and, again,
> anything BUT the [support people] any newcomer might expect
> for real computer programming material.
>
> There are other serious issues with Perl, not the least of
> which was the prosecution of one of it's principals for "hacking"...
> this charge never seemed entirely warranted, but the story doesn't
> make Perl any more attractive, commercially.
>
> Perl, I feel, remains unappreciated by most people, whether
> or not they have used it extensively... but the real point of
> this message was to bail out Larry W... or at least explain his
> plight, and offer a possible answer. I, for one, find it
> unlikely he would sacrifice economic security for the sake of
> developing a new Perl framework... maybe, part of the new Perl
> was to exclude some of the amateurish, stiflingly ineffacious
> "expert documentation", or developmental directions...
> ...otherwise, it can't really be argued - Perl has real
> usefulness, and there are likely endless business ventures who
> could offer L.W. substantial monetary aid in exchange for his
> expertise... but what is the real issue here ?
> Is it even Perl related ? Is it open-source versus MicroSoft ?
> Is it possible one gigantic freeware package is simply enough to
> expect of one person in their lives ?
> Linus got a job... why shouldn't Larry ? :)
> I don't think either of them would, or should, opt for
> dependency on an uncertain thing like the WWW/Internet... why
> the whole Dot/Com blowout, do we imagine ? Its the same problem...
> no permanence, solidity, or lasting value there... a boom market
> with it's own built-in bust clientele.
> I hope L.W. finds his way out of whatever problem it is,
> sooner than later. Perl is perhaps as valuable as a lesson to
> those who (wrongly) accept the Internet as an opportunity it
> never proved itself to be.
------------------------------
Date: 23 Jul 2003 19:02:26 -0700
From: stuseven@hotmail.com (stu7)
Subject: Re: Larry W... out of work ?? Impossible... or...
Message-Id: <d7dd90b0.0307231802.40403080@posting.google.com>
Alasdair Allan <aa@ukrecscuba.org.uk> wrote in message
news:<bfkr0h$g05fr$1@ID-188041.news.uni-berlin.de>...
> Google is not usenet, usenet is not the web
*** No, Google is simply the largest newsgroup carrier...
*** and Google runs from the Web... go figure.
*** newsgroups/usenet are both becoming largely outmoded_
*** what was the question ? Oh wait, I remember, style
*** whines... ok... continue :)
> If you took a class in how to use email and usenet, may I respectfully
> suggest you haven't been around the net long enough to hold an opinion
> on what constitutes good style?
*** No you may not. Respect has nothing to do with your reply,
*** and neither is it in the "friendly advice" category. If
*** you're trying to say, anyone who didnt write an original
*** internet protocol doesnt deserve to comment on it's use or
*** usefulness, I cant agree.
> Stylistically usenet settled down sometime in the early 80's,
*** all that long ? Why dont you... settle down I mean ? :)
> well before
> the great renaming in '86. There weren't any classes on how to use net
> related things back then, we all just had to pick it up as we went along,
> in alot of cases, we has to write the tools to do the stuff as went along.
*** so really, you and these other people are the ones responsible
*** for all this trouble ? Im not sure if it's safe to admit to that :)
> Your quoting convention is wierd, trust me.
*** I already said, I dont trust you. And, no, it isnt "weird".
No don't bother, see
> http://www.netmeister.org/news/learn2quote.html and take their word
> for it...
*** I guess its fruitless to discuss anything with someone who
*** JUST DOESNT GET THE POINT... I didnt post here to be
*** style-critiqued - but then, none of your comments are
*** especially valid anyway. Having successfully used a working
*** style for years on end, I simply dont care about such
*** comments, to be blunt.
specifically section 3.1
>
*** Now youre going to start quoting some "official source"
*** also unrelated to anything I posted ?
> The sheer lack of knowledge that this paragraph hints at is mind
> boggling...
*** I really think you have proven you have no intention of
*** helping with my inquiry... name calling puts you with the
*** troublemaker group. Go away, and leave me alone, please :)
> why on Earth shouldn't web pages work on a laptop? What does the
> harware have to do with anything?
*** oh, oh... I know this one... is it vast differences in
*** screen sizes or output formats ? Thats the typical problem.
*** I'll go one step further... read the post... what I said
*** was, "it works fine on Google (where I post), and works
*** fine for me (thats me)_ and therefore, I am content with
*** the practice as it is used.
> Al.
*** I knew right away you were at least -trying- to say
*** something meaningful, because your signature was so short.
*** However, I have to tell you - this is Google, not Boggle :)
------------------------------
Date: 24 Jul 2003 02:14:09 GMT
From: "A. Sinan Unur" <asu1@c-o-r-n-e-l-l.edu>
Subject: Re: Larry W... out of work ?? Impossible... or...
Message-Id: <Xns93C1E23331486asu1cornelledu@132.236.56.8>
stuseven@hotmail.com (stu7) wrote in
news:d7dd90b0.0307231725.ca90aff@posting.google.com:
> *** The fact that "Sinan Unar","Keith Keller",
Hmmmmm ... That is 'Unur'.
> *** "Martien Verbruggen", "Eric Roode", or "Gregory
> *** Toomey", all got together to harass me, and belittle
> *** my well meant post
Maybe you don't like being called on your misrepresentations. Nothing I
can do about that.
...
> *** I was a little surprised to see anyone named
> *** randal schwartz jump on this teetering bandwagon
> *** of jeering spammers... isnt he supposed to be one of
> *** the good guys ?
The fact that everyone but you is using his real name indicates
something.
--
A. Sinan Unur
asu1@c-o-r-n-e-l-l.edu
Remove dashes for address
Spam bait: mailto:uce@ftc.gov
------------------------------
Date: 23 Jul 2003 19:16:32 -0700
From: stuseven@hotmail.com (stu7)
Subject: Re: Larry W... out of work ?? Impossible... or...
Message-Id: <d7dd90b0.0307231816.4ada2549@posting.google.com>
> merlyn@stonehenge.com (Randal L. Schwartz) wrote in message news:<40ddfa96a9a18724999cbc0c222a6056@free.teranews.com>...
> > This is your first factual mistake, and it only goes downhill from
> > here. Perl has been around since long before IP packets were flowing
> > near your sorry hiney.
*** I took a second look at this remark, and noticed - it isnt
*** just cutesy and spammie, but almost hostile. I guess really
*** it's in the playground level profanity category, so OK :)
***
*** A slogan... thats what Perl needs... something like,
*** "Real men, using real playground level profanities, as they
*** build an exciting new language_ working against all odds,
*** in a world that just didnt seem to care".
*** I dunno how this is going to go over with hollywood, but
*** dont say I didnt try. :)
***
*** No_ Im just kidding... I guess its the other people who
*** were serious. OK, Im done.
------------------------------
Date: 23 Jul 2003 19:32:08 -0700
From: stuseven@hotmail.com (stu7)
Subject: Re: Larry W... out of work ?? Impossible... or...
Message-Id: <d7dd90b0.0307231832.3d192605@posting.google.com>
*** well, this is another issue. In Iraq, Saddam told
*** the people he was working for the good of a greater
*** Iraq... the U.S. didnt agree - but opinions vary.
***
*** There used to be a comedian with the name Steve Allen(sp ?)...
*** I mention this, because I considered this non-reply in
*** particular one of the most humorous... but do you want a
*** recap of all my favorite old time comedians ?
*** Would that be stylistically correct in this newsgroup ?
***
*** There simply were no style issues addressed in my original
*** post. Answering with a non-answer... although it is
*** a popular recreation here... isnt any more useful or
*** appreciated.
***
*** Shuffling of feet back to the official style whiners
*** clubhouse... "yea... we sure showed that one poster...
*** yea, yea".
Steve Allan <stevea@wrq.com> wrote in message news:<uu19d0win.fsf@wrq.com>...
> "Eric J. Roode" <REMOVEsdnCAPS@comcast.net> writes:
> >Let me suggest a counter-analogy. Suppose you're walking down a sidewalk
> >in a neighborhood you're familiar with. A car pulls up with the radio
> >blaring and honks repeatedly at you. When you go over to see what his
> >problem is, he says, "Hey, I need to get to 4th and Broad. Tell me how
> >to get there. Now come on, make it snappy!" And then he tosses a
> >cigarette butt out of his car at your feet.
------------------------------
Date: Wed, 23 Jul 2003 21:47:53 -0500
From: "Eric J. Roode" <REMOVEsdnCAPS@comcast.net>
Subject: Re: Larry W... out of work ?? Impossible... or...
Message-Id: <Xns93C1E7DF1E85Fsdn.comcast@206.127.4.25>
-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1
stuseven@hotmail.com (stu7) wrote in
news:d7dd90b0.0307231832.3d192605@posting.google.com:
> *** There simply were no style issues addressed in my original
> *** post. Answering with a non-answer... although it is
> *** a popular recreation here... isnt any more useful or
> *** appreciated.
That's fine. Do what you want. If you refuse to learn couth, there's
nothing that I can do about it, and I won't waste any more of my time
trying. If you need help with a Perl issue, don't expect an answer from
me. And I expect that I won't be the only one.
You may not care. That's fine -- I won't care either.
- --
Eric
$_ = reverse sort qw p ekca lre Js reh ts
p, $/.r, map $_.$", qw e p h tona e; print
-----BEGIN xxx SIGNATURE-----
Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>
iQA/AwUBPx9Iv2PeouIeTNHoEQJEwwCdGXplF443UHAR4XxTu7g/x8PmlE4An3w9
5J9ItrA+cPtfCu6ZkPK8zA77
=qjny
-----END PGP SIGNATURE-----
------------------------------
Date: 24 Jul 2003 02:52:42 GMT
From: Alasdair Allan <aa@ukrecscuba.org.uk>
Subject: Re: Larry W... out of work ?? Impossible... or...
Message-Id: <bfnhlq$h21k2$1@ID-188041.news.uni-berlin.de>
stu7 wrote:
> *** I didnt post here to be style-critiqued...
Then you should have used a standard style so that your wierd and off the
wall style didn't distract so much from you original point, which I now
forget.
Al.
------------------------------
Date: Thu, 24 Jul 2003 02:56:17 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Larry W... out of work ?? Impossible... or...
Message-Id: <lVHTa.65747$kI5.46768@nwrddc02.gnilink.net>
stu7 wrote:
> *** OK, Im done.
I take your word on that. I just hope you will keep your promise!
jue
------------------------------
Date: Wed, 23 Jul 2003 23:07:27 +0100
From: pkent <pkent77tea@yahoo.com.tea>
Subject: Re: priority queue
Message-Id: <pkent77tea-79250F.23072723072003@usenet.plus.net>
In article <20030722134425.296$Vx@newsreader.com>, ctcgag@hotmail.com
wrote:
> "j" <perseus_medusa@hotmail.com> wrote:
> > I am trying to implement a priority queue where people will submit
> > some job through cgi written in perl and then another independent perl
> > script will clear the queue. Different submitter has different priority.
> > What's the best way to implement a global queue that can be accessed by
> > the cgi and the perl script concurrently? We cannot use database though.
>
> Why can you not use a database? Without knowing the rationale behind that
> restriction, it's kind of hard to predict what solutions are available that
> you *can* use.
At work we have a distributed batch queueing systems where jobs are
submitted from anywhere in our network and the various jobs are taken
off the queue and done on any one of several worker machines. The whole
thing is tied together with a single MySQL database runnign on a central
server which stores the state of all the jobs, queues, etc. So my advice
is "network-accessible database"
If you can't use a database then I suppose a filesystem implementation
is the way to go - e.g. each job is represented by a file, you use a
lockfile somewhere to ensure that only one process modifies the folder
of jobs at any one time. Place all that behind an API so that you can,
if you want, move to another implementation without rewriting the whole
thing. The problem with the filesystem is that you need to be careful to
avoid race conditions (whereas I'd think a database handles that all for
you) and flock() might not work on all OSes or over NFS.
You could, I suppose, use a dbm file, or shared memory or some kind of
client/server approach. Still, maybe you don't want to limit the system
to running on a single machine.
P
--
pkent 77 at yahoo dot, er... what's the last bit, oh yes, com
Remove the tea to reply
------------------------------
Date: Thu, 24 Jul 2003 00:35:35 +0100
From: Chad Hanna <chad@vellum.demon.co.uk>
Subject: Re: Problem with IE and Cookie
Message-Id: <HF6lt4MHvxH$EwNf@vellum.demon.co.uk>
In message <4c08aaff.0307230901.517085b5@posting.google.com>, Vijoy
Varghese <viijv@thedifferenZ.com> writes
>Hi Friends,
>
>I created a cgi program which make use of the cookies to check user
>authentication. And for creating cookies i make use of cgi::cookie. I
>am having a weird problem...
>
>use CGI::Cookie;
>
>my $cookie1 = cookie(-name => 'foo',
> -value => 'bar',
> -expires => '+3M'
> );
>print header(-cookie=>[$cookie1]);
>
>
>
>My cookie program works fine when i run the program on the local
>webserver and view it on my internet explorer/mozilla browsers.
>
>But when i tried the same program from a remote webserver the scipt is
>not working properly with internet explorer. Everything is fine with
>mozilla.
>
>When i tried to debug the problem, i found that cookies are not
>falling to IE's cookie folder when i use the remote script. But when i
>tried the script from a frineds house and used IE, everything is
>working fine. And if you doubt that i havenot properly set my cookies
>setting of my IE, no! everythingis properly configured. I can see
>cookies from other websites in my cookie folder, but my program is not
>able to put any cookies. Why is this so?
>
>It's not the problem of my program, because its working properly in
>other browsers(other than my home one).
>It cant be the problem of my browser, because the script works
>properly using a local webserver, and on internet cookies from all
>other websites works fine.
>
>Then who is the culprit?
>
>please help
>
>Regards
>Vijoy Varghese.
Setting a cookie that expires 3 minutes in the future is NOT a good idea
- as I found out.
The clocks on many computers are out of sync with reality - wrong time,
wrong time zone, wrong year! In other words, the cookie may have already
expired as far as the browser's concerned (the +3M is converted to a
real time at the server end - not the client end).
Far better to use a session cookie and check the received cookie against
an expiry time stored at the server - tedious isn't it.
I believe there is a new cookie spec that resolves this problem but
everyone is stuck with the old way of doing things.
Hope this helps
--
Chad Hanna
Chairman Berkshire Family History Society www.berksfhs.org.uk
Quality Family History Data www.familyhistoryonline.net
------------------------------
Date: Wed, 23 Jul 2003 16:19:39 -0400
From: Ted Zlatanov <tzz@lifelogs.com>
Subject: Re: Q- Empirical usable upper limit on hash array number of elements
Message-Id: <4nk7a99esk.fsf@chubby.bwh.harvard.edu>
On 9 Jul 2003, carltonbrown@hotmail.com wrote:
> I'm trying to work a simple union problem that will result in some
> extremely large hashes (minimum 2 million elements, possibly up to
> 100 million at some point, no key or value will be larger than 64
> bytes). So I'm wondering if anyone has had practical experience
> using hashes with extremely large numbers of elements, and if so,
> did you encounter any logical or practical limit? Has anyone used
> hashes of up to 100 million elements without experiencing
> unreasonable slowness or unpredictable behavior?
[...]
> The essence of the problem is to take extremely large list A,
> compare it to slightly smaller list B, and identify the elements
> from list A that are not found in list B.
Have you considered something like BerkeleyDB instead of storing these
hashes in memory? Not only will it avoid memory issues, but it will
also allow you to use C code on the resulting databases. I'm not sure
about the upper bound of BerkeleyDB storage (though you can probably
split the database into hash-based buckets), so if you have any
insight please share! I'd certainly find it useful.
Ted
------------------------------
Date: Wed, 23 Jul 2003 14:35:59 -0400
From: Jeff 'japhy' Pinyan <pinyaj@rpi.edu>
Subject: Re: Regex help (? as delimiter)
Message-Id: <Pine.SGI.3.96.1030723143525.124515A-100000@vcmr-64.server.rpi.edu>
On Wed, 23 Jul 2003, John Strauss wrote:
>On 23 Jul 2003 09:55:27 -0700
>lawrence.tierney@bipcontracts.com (Lawrence Tierney) wrote:
>>
>> Hello,
>>
>> I've got something going on with a regex which I don't quite
>> understand. I'm trying to match the following string:
>>
>> (OS/S 140-126484/EN)
>>
>> $data=~/^\(\d{2}\/[A-Z] \d{1,3}-\d{3,6}\/EN\)$/; # Works okay
>>
>no, it doesn't match. should that first \d be \D?
>
>>
>> $data=~?^\(\d{2}/[A-Z] \d{1,3}-\d{3,6}/EN\)$?; # Doesn't match
>>
>right, it doesn't match.
>
>>
>> I tried using the ? as my delimiter to prevent having to escape the
>> forward slashes.
>>
>as for using ? as a regexp delimiter, it's
>allowed but it's an odd choice, IM(very)HO.
Yes, it's allowed, but it does something different than any other regex
delimiter. It only matches ONCE successfully inbetween calls to the
reset() function.
--
Jeff Pinyan RPI Acacia Brother #734 2003 Rush Chairman
"And I vos head of Gestapo for ten | Michael Palin (as Heinrich Bimmler)
years. Ah! Five years! Nein! No! | in: The North Minehead Bye-Election
Oh. Was NOT head of Gestapo AT ALL!" | (Monty Python's Flying Circus)
------------------------------
Date: Wed, 23 Jul 2003 14:40:16 -0400
From: Jeff 'japhy' Pinyan <pinyaj@rpi.edu>
To: Lawrence Tierney <lawrence.tierney@bipcontracts.com>
Subject: Re: Regex help (? as delimiter)
Message-Id: <Pine.SGI.3.96.1030723143605.124515B-100000@vcmr-64.server.rpi.edu>
[posted & mailed]
On 23 Jul 2003, Lawrence Tierney wrote:
>$data=~?^\(\d{2}/[A-Z] \d{1,3}-\d{3,6}/EN\)$?; # Doesn't match
>
>I tried using the ? as my delimiter to prevent having to escape the
>forward slashes.
>
>The regex is contained within a loop i.e
>
>foreach my $data(@stuff){# simplified
> # regex etc here
>}
As far as your regex WORKING, you've been told there's a slight error.
The problem you'll encounter next is that you've chosen ? to be that regex
delimiter, and when you use ?, Perl does something extra with your regex:
it only lets the regex match ONCE successfully in between calls to the
reset() function. This is documented, but unless you think of looking for
it, you probably won't notice it.
Just don't use ? as the delimiter. Use m{...} or m!...!.
--
Jeff Pinyan RPI Acacia Brother #734 2003 Rush Chairman
"And I vos head of Gestapo for ten | Michael Palin (as Heinrich Bimmler)
years. Ah! Five years! Nein! No! | in: The North Minehead Bye-Election
Oh. Was NOT head of Gestapo AT ALL!" | (Monty Python's Flying Circus)
------------------------------
Date: 23 Jul 2003 13:58:37 -0700
From: puissant00@yahoo.com (Go Perl)
Subject: request for perl TK Example
Message-Id: <d3825316.0307231258.34008938@posting.google.com>
I am trying to develop GUI on win-32 using perl/TK. I am reading stuff
on it and i would like to know if anyone can provide me a sample
script so that i can play around with it and if needed alter it to my
needs. All i want from this GUI is to a couple of radio buttons to
select the particular script to run and then some variables to be
passed into the script and then hit run for the simulation.
I will be glad if anyone can help me in this. I am newbie when it
comes to working on TK.
Thanks in advance
------------------------------
Date: 23 Jul 2003 20:39:39 -0700
From: johndporter@yahoo.com (John Porter)
Subject: Re: request for perl TK Example
Message-Id: <95f344ba.0307231939.7f35f507@posting.google.com>
puissant00@yahoo.com wrote:
> I am trying to develop GUI on win-32 using perl/TK.
> ... a couple of radio buttons to
> select the particular script to run and then some variables to be
> passed into the script and then hit run for the simulation.
Using Tk in perl is disconcertingly simple. You start with
use Tk;
my $mw = MainWindow;
MainLoop;
Run that. It displays a blank window. Now you've got something you
can add wigets to.
(Skipping ahead a bit...)
Here's a program which tries to meet your stated criteria, but
I tried to make it as short as possible, without being obfuscated.
#!/usr/bin/perl
use strict;
use warnings;
use Tk;
my $mw = new MainWindow;
# you need to configure these lists:
my @script_names = ( "foo.pl", "bar.pl" );
my @arg_names = ( "quantity", "quality", "email" );
my $script_to_run = $script_names[0];
for ( @script_names )
{
my $fr = $mw->Frame->pack;
$fr->Radiobutton( -variable => \$script_to_run,
-value => $_ )->pack( -side => 'left' );
$fr->Label( -text => $_ )->pack( -side => 'left' );
}
my %arg_entry_widgets; # keyed by arg name
for ( @arg_names )
{
my $fr = $mw->Frame->pack;
$fr->Label( -text => "$_:" )->pack( -side => 'left' );
$arg_entry_widgets{$_} = $fr->Entry( )->pack( -side => 'left' );
}
$mw->Button( -text => "Run", -command => \&run )->pack;
MainLoop;
sub run
{
$mw->Busy( -recurse => 1 ); # make the main window busy
my @args;
for ( @arg_names )
{
my $val = $arg_entry_widgets{$_}->get;
length $val and push @args, "-$_ $val";
}
# go do whatever it is
print "running $script_to_run @args\n";
system $script_to_run, @args;
$mw->Unbusy;
}
Of course, for your purposes, you'll probably need to modify and
enhance this code quite a bit.
Hope this helps.
--
John Douglas Porter
------------------------------
Date: Thu, 24 Jul 2003 03:47:43 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: request for perl TK Example
Message-Id: <3F1F56C4.9040005@rochester.rr.com>
Go Perl wrote:
> I am trying to develop GUI on win-32 using perl/TK. I am reading stuff
> on it and i would like to know if anyone can provide me a sample
> script so that i can play around with it and if needed alter it to my
> needs. All i want from this GUI is to a couple of radio buttons to
> select the particular script to run and then some variables to be
> passed into the script and then hit run for the simulation.
>
> I will be glad if anyone can help me in this. I am newbie when it
> comes to working on TK.
> Thanks in advance
>
You should be able to type:
widget
at your command prompt and try out dozens of Tk examples, complete with
displays, listing, commentary. widget should have been made available
when you installed Tk. Wonderful little program.
--
Bob Walton
------------------------------
Date: Wed, 23 Jul 2003 21:48:35 GMT
From: Bart Lateur <bart.lateur@pandora.be>
Subject: Re: Retrieving Data from Microsoft Access Database using Perl
Message-Id: <qk0uhvorlf2i4o9vh7bap4picik8931dr4@4ax.com>
Thomas Rawley wrote:
>$DSN = 'driver=Mircosoft Access Driver (*.mdb);dbq=MyEasinetEvents.mdb';
^^
This has to be a typo...
--
Bart.
------------------------------
Date: 23 Jul 2003 21:41:44 GMT
From: Alasdair Allan <aa@ukrecscuba.org.uk>
Subject: Re: Soap::Lite and hashes
Message-Id: <bfmveo$gl15p$1@ID-188041.news.uni-berlin.de>
Sascha Moellering wrote:
> Alasdair Allan wrote:
> > I'm using SOAP::Transport::HTTP::Daemon as I didn't have a handy
> > server around to use the CGI module as you did in your example....
>
> I think, I can't use this solution, because I have to send the data using
> SSL...
I don't understand, what does SSL have to do with it? the Daemon module
doesn't support it, but just use the CGI or Apache module instead, its
just a direct swap in the server code.
> I even tried to dereference the hash, but that does not work:
Well, no, obviously...
Al.
------------------------------
Date: Thu, 24 Jul 2003 03:10:01 GMT
From: Joseph Ellis <jandellis@hotmail.com>
Subject: Style question regarding subroutines and lexical variables
Message-Id: <3giuhv8v1atb61lrdorsaf41cu6pkl3q33@4ax.com>
Hello all...I am fairly new to Perl and am hoping to glean some advice
from those of you who have been around the Perl block a few times.
I am currently writing a program that consists of a handful of
subroutines, with one subroutine calling another subroutine, etc, all
to generate a particular hash.
So far I'm giving most of my variables file scope, but I don't think
that's really the best thing to do, stylistically and otherwise.
Consider the following (syntax notwithstanding)...
my $l, $m, $n, $o, $p;
my %hash;
sub one {
use / modify all those global variables;
&two();
return %hash;
}
sub two {
use / modify a couple of the scalars and the hash;
&three();
}
sub three {
use / modify a couple of the other scalars and the hash
}
Would it be advisable / more efficient / more aesthetically pleasing /
just plain better to create lexical variables within each subroutine,
passing copies of them around as arguments, or is the above
pseudo-script fine the way it is?
What if there were 15 variables and 20 subroutines? Or 30 variables
and 5 subroutines?
I'm just curious as to which method is better (subjectively or
objectively).
Thanks.
Joseph
------------------------------
Date: 24 Jul 2003 03:33:32 GMT
From: "A. Sinan Unur" <asu1@c-o-r-n-e-l-l.edu>
Subject: Re: Style question regarding subroutines and lexical variables
Message-Id: <Xns93C1EFA89831asu1cornelledu@132.236.56.8>
Joseph Ellis <jandellis@hotmail.com> wrote in
news:3giuhv8v1atb61lrdorsaf41cu6pkl3q33@4ax.com:
> Hello all...I am fairly new to Perl and am hoping to glean some advice
> from those of you who have been around the Perl block a few times.
Disclaimer: I haven't been around the block even once yet.
If you haven't done so already, I will recommend taking a look at:
perldoc perlsub
> I am currently writing a program that consists of a handful of
> subroutines, with one subroutine calling another subroutine, etc, all
> to generate a particular hash.
>
> So far I'm giving most of my variables file scope, but I don't think
> that's really the best thing to do, stylistically and otherwise.
>
> Consider the following (syntax notwithstanding)...
>
> my $l, $m, $n, $o, $p;
> my %hash;
>
> sub one {
> use / modify all those global variables;
> &two();
> return %hash;
> }
perlsub has this to say:
Not only does the "&" form make the argument list optional, it also
disables any prototype checking on arguments you do provide. This is
partly for historical reasons, and partly for having a convenient way
to cheat if you know what you're doing. See Prototypes below.
You really do not need to use &two(), two() will do just fine.
>
> sub two {
> use / modify a couple of the scalars and the hash;
> &three();
> }
>
> sub three {
> use / modify a couple of the other scalars and the hash
> }
>
> Would it be advisable / more efficient / more aesthetically pleasing /
> just plain better to create lexical variables within each subroutine,
> passing copies of them around as arguments, or is the above
> pseudo-script fine the way it is?
You can pass around references to the hashes. That way, you do not need
to make changes to the code in the subroutines if you change the names of
the hashes or other variables you are modifying, and you avoid creating
copies of large data structures.
> What if there were 15 variables and 20 subroutines? Or 30 variables
> and 5 subroutines?
Regardless of language, if I see a method/function/subroutine being
called with 30 arguments, I am inclined to think there is a design issue.
But I am really not sure what you mean by these.
Sinan
--
A. Sinan Unur
asu1@c-o-r-n-e-l-l.edu
Remove dashes for address
Spam bait: mailto:uce@ftc.gov
------------------------------
Date: Sat, 19 Jul 2003 01:59:56 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re:
Message-Id: <3F18A600.3040306@rochester.rr.com>
Ron wrote:
> Tried this code get a server 500 error.
>
> Anyone know what's wrong with it?
>
> if $DayName eq "Select a Day" or $RouteName eq "Select A Route") {
(---^
> dienice("Please use the back button on your browser to fill out the Day
> & Route fields.");
> }
...
> Ron
...
--
Bob Walton
------------------------------
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.
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 5264
***************************************