[24772] in Perl-Users-Digest
Perl-Users Digest, Issue: 6925 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Aug 28 14:06:08 2004
Date: Sat, 28 Aug 2004 11:05: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 Sat, 28 Aug 2004 Volume: 10 Number: 6925
Today's topics:
Re: Execute Windows program from Perl script (??) <bowsayge@nomail.afraid.org>
Re: Execute Windows program from Perl script (??) <jurgenex@hotmail.com>
Re: Execute Windows program from Perl script (??) (Tony McGuire)
Re: Execute Windows program from Perl script (??) <jurgenex@hotmail.com>
Re: Execute Windows program from Perl script (??) <scobloke2@infotop.co.uk>
Re: Execute Windows program from Perl script (??) (Tony McGuire)
Re: Execute Windows program from Perl script (??) <jurgenex@hotmail.com>
Re: How do you lock a file BEFORE changes are made? <noemail@#$&&!.net>
Re: How to find out if a string is in uppercase only <someone@example.com>
Re: How to find out if a string is in uppercase only <jurgenex@hotmail.com>
Re: How to find out if a string is in uppercase only <uri@stemsystems.com>
Re: How to find out if a string is in uppercase only <jurgenex@hotmail.com>
Re: How to find out if a string is in uppercase only <noreply@gunnar.cc>
Re: How to find out if a string is in uppercase only <flavell@ph.gla.ac.uk>
Re: How to find out if a string is in uppercase only <jurgenex@hotmail.com>
Re: How to unzip backup files of RaQ4 server? (Andy Signer)
Re: Larry Wall & Cults jmfbahciv@aol.com
Newbie Frontier::Daemon problem <lepi_MAKNI_ME_@fly.srk.fer.hr>
pass 2d array to C function (min)
Re: performance surprise -- why? (Anno Siegel)
Re: using the result of a variable regular expression <bowsayge@nomail.afraid.org>
Re: using the result of a variable regular expression <nobull@mail.com>
Re: using the result of a variable regular expression (Anno Siegel)
Re: Xah Lee's Unixism jmfbahciv@aol.com
Re: Xah Lee's Unixism <amajorel@teezer.fr>
Re: Xah Lee's Unixism <scobloke2@infotop.co.uk>
Re: Xah Lee's Unixism <spam@mouse-potato.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 28 Aug 2004 10:18:56 GMT
From: bowsayge <bowsayge@nomail.afraid.org>
Subject: Re: Execute Windows program from Perl script (??)
Message-Id: <k_YXc.2455$6o3.1936@newsread2.news.atl.earthlink.net>
Tony McGuire said to us:
> Brian McCauley <nobull@mail.com> wrote
>>
>> You enclose it in double quotes.
>
> And that doesn't work. I tried that, and several variations.
<OT>
This is 100% untested:
system('start c:/Progra~1/etc/etc.exe');
Or try
system("start c:\\Progra~1\\etc\\etc.exe");
</OT>
------------------------------
Date: Sat, 28 Aug 2004 13:15:15 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Execute Windows program from Perl script (??)
Message-Id: <Dz%Xc.525$Cj5.80@trnddc04>
Brian McCauley wrote:
> Jürgen Exner wrote:
>
>> system("\"c:\program files\etc\etc.exe\"")
>
> Do not rely on \p and \e not being defined escapes.
>
> system("\"c:\\program files\\etc\\etc.exe\"")
>
> (I assume you, Jürgen, knew that really but it's worth correcting for
> the sake of anyone else reading).
Ouch, sorry. Didn't even see that.
Thank you!
jue
------------------------------
Date: 28 Aug 2004 07:17:45 -0700
From: tony@paradoxcommunity.com (Tony McGuire)
Subject: Re: Execute Windows program from Perl script (??)
Message-Id: <f896a829.0408280617.4795bac7@posting.google.com>
Brian McCauley <nobull@mail.com> wrote in message
>
> > The web page I post from just sits there as if the perl
> > were executing.
>
> Sorry, I hadn't clocked your original question as a stealth CGI
> question. (Please don't do hat, see the posting guidelines).
>
I wish I knew what you meant, here.
I'm trying to start a program (Textpad.exe is a text editor) from a
perl script. The perl script is executed with a web page. I am
trying to load that program on the web server. The web server is a
Windows box.
Am I doing it wrong by trying to use perl? Should I for some reason
be using CGI?
I haven't a clue why or where you use one instead of the other. I
just found the examples for uploading files, and it was all perl; so
that's what I stuck with.
------------------------------
Date: Sat, 28 Aug 2004 15:00:39 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Execute Windows program from Perl script (??)
Message-Id: <r61Yc.336$bD5.70@trnddc03>
Tony McGuire wrote:
> Brian McCauley <nobull@mail.com> wrote in message
>>
>>> The web page I post from just sits there as if the perl
>>> were executing.
>>
>> Sorry, I hadn't clocked your original question as a stealth CGI
>> question. (Please don't do hat, see the posting guidelines).
>
> I wish I knew what you meant, here.
>
> I'm trying to start a program (Textpad.exe is a text editor) from a
> perl script.
So far so good, that's easy (using Notepad as a substitute because I
couldn't test it with Textpad.exe):
use warnings; use strict;
system ('notepad.exe');
> The perl script is executed with a web page.
This part is, well, at least ambiguous. Web pages are HTML, they don't
"execute" other programs.
Maybe you are talking about DHTML, maybe you are talking about ActiveX
controls, maybe you are talking about ASP, maybe you are talking about CGI
scripts?
> I am
> trying to load that program on the web server. The web server is a
> Windows box.
Now, what do you mean by "load that program"? Do you want to execute that
program on the server? Then I guess you are talking about a CGI script that
is written in Perl?
Would be a bit unusual to run an interactive text editor on a server that is
tucked away in a basement without even a terminal attached to it, but of
course it's your choice.
From a Perl point of view that shouldn't be much different from above. Of
couse now you got all the added complexity of web servers, CGI, etc. You
better ask in a NG that is dedicated to those topics, because people there
will be much more knowledgable about it then people in a Perl NG.
Just remember that system() doesn't return until the called program is
terminated. This might be difficult to do on a server. Do you really want to
go down there and terminate the program every time someone visits that web
page?
If you want to continue running the Perl script concurrently to the external
program then check out fork() and exec().
> Am I doing it wrong by trying to use perl? Should I for some reason
> be using CGI?
This is like asking "Am i doing it wrong by using a car? Should I be using
green instead?"
> I haven't a clue why or where you use one instead of the other.
There is no "instead of", those terms belong into different universes.
Perl is a programming language. CGI is the Common Gateway Interface. They
have nothing to do with each other except that some CGI programs (quite a
few actually) happen to be written in Perl.
Just like cars and the color green. Although some cars happen to be painted
green, the one really has nothing to do with the other and the question
"should I use green instead of a car" doesn't make much sense.
jue
------------------------------
Date: Sat, 28 Aug 2004 15:46:27 +0000 (UTC)
From: Ian Wilson <scobloke2@infotop.co.uk>
Subject: Re: Execute Windows program from Perl script (??)
Message-Id: <cgq9cj$hfi$1@hercules.btinternet.com>
Jürgen Exner wrote:
> Brian McCauley wrote:
>
>>Jürgen Exner wrote:
>>
>>
>>> system("\"c:\program files\etc\etc.exe\"")
>>
>>Do not rely on \p and \e not being defined escapes.
>>
>>system("\"c:\\program files\\etc\\etc.exe\"")
>>
>>(I assume you, Jürgen, knew that really but it's worth correcting for
>>the sake of anyone else reading).
>
system('"c:/Program Files/Internet Explorer/IEXPLORE.EXE"')
works for me, and I find "/" looks clearer than "\\". YMMV
------------------------------
Date: 28 Aug 2004 09:14:29 -0700
From: tony@paradoxcommunity.com (Tony McGuire)
Subject: Re: Execute Windows program from Perl script (??)
Message-Id: <f896a829.0408280814.760cf02c@posting.google.com>
tony@paradoxcommunity.com (Tony McGuire)
> system( "start", "C:\Program Files\TextPad 4\TextPad.exe");
>
> There is no error. The web page I post from just sits there as if the perl
> were executing. And when I check the 'server' box I find a cmd.exe in Task
> Mangler, one for each time I run the script.
>
> And the only way to remove the 'hidden' copy of cmd.exe (there's no DOS box
> up) is to reboot Windows. When I try to end task on them, I get 'Access
> Denied'.
I guess what I am looking for isn't doable from perl.
I was looking to start a Windows program independent of the Apache
umbrella. This program would then rewrite the config file for Apache
and restart Apache.
But I doubt Apache will restart if there is a process running, which
there would be if perl must wait on anything it starts with system().
Well, back to the drawing board. I guess I'll write to a file (with
perl), and have a scheduler watch for the file to be changed - then
kick off that other Windows program using the scheduler. That way the
Windows program is running independently of Apache and the perl
script.
I was hoping to coordinate everything with just perl, but it doesn't
seem to be up to this particular task.
------------------------------
Date: Sat, 28 Aug 2004 18:00:41 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Execute Windows program from Perl script (??)
Message-Id: <dL3Yc.290$Gr2.27@trnddc07>
Tony McGuire wrote:
> there would be if perl must wait on anything it starts with system().
That is putting the cart before the horse!
If you would have bothered to read the documentation for the functions you
are using you would have noticed:
system LIST
system PROGRAM LIST
Does exactly the same thing as "exec LIST", except that a fork
is done first, and the parent process waits for the child
process to complete. [...]
In other words: waiting for the called program to terminate is not a
limitation but a designed and wanted feature of system(). How else would you
return the return value of the called program anyway?
If you want a different behaviour then use a different function.
Complaining that the multiplication operator doesn't substract is kind of
beside the point.
jue
------------------------------
Date: Sat, 28 Aug 2004 08:37:23 -0500
From: Fred <noemail@#$&&!.net>
Subject: Re: How do you lock a file BEFORE changes are made?
Message-Id: <pan.2004.08.28.13.37.23.144979@#$&&!.net>
> : Not only is this approach unfavorable because it uses extra lines of :
> code that seem unnecessary, but according to "perldoc -f truncate", :
> calling truncate() "produces a fatal error if truncate isn't :
> implemented on your system," which makes me think that it's not all :
> that portable.
>
> Did you not see the same note attached to "perldoc -f flock"? It too
> will cause a fatal error on a system where it is not implemented.
>
> How much portability do you really need? Is it worth jumping through
> hoops to make your program accommodate every platform that can run Perl?
OK, I'm a newbie more or less, but one of the things aside from:
#!/usr/bin/perl -w # ignored by winders{ms$} That I have always admired
about perl was the wonderful cross-platform aspect. I get a real kick out
of the fact that my perl code runs on WinXP and Linux, so to my way of
thinking that's a great asset, IMHO.
you know there are exceptions, like using ODBC and the file system
stuff.... but out THERE somewhere, these matters will be resolved.......
------------------------------
Date: Sat, 28 Aug 2004 10:46:39 GMT
From: "John W. Krahn" <someone@example.com>
Subject: Re: How to find out if a string is in uppercase only
Message-Id: <joZXc.22871$A8.20979@edtnps89>
leifwessman@hotmail.com wrote:
>
> How do I find out if a string is uppercase only? I've searched cpan for
> a suitable module, but found nothing.
>
> This is what I'm looking for:
>
> is_uppercase("UPPERCASE ÅÄÖ") # TRUE
> is_uppercase("UPPERCaSE ÅÄÖ") # FALSE
>
> Thanks for any input on how to create such a method.
> Leif
>
> Note: ÅÄÖ is swedish characters.
sub is_uppercase { require locale; $_[0] eq uc $_[0] }
John
--
use Perl;
program
fulfillment
------------------------------
Date: Sat, 28 Aug 2004 13:18:27 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: How to find out if a string is in uppercase only
Message-Id: <DC%Xc.526$Cj5.221@trnddc04>
leifwessman@hotmail.com wrote:
> Hi!
>
> How do I find out if a string is uppercase only? I've searched cpan
> for a suitable module, but found nothing.
>
> This is what I'm looking for:
>
> is_uppercase("UPPERCASE ÅÄÖ") # TRUE
> is_uppercase("UPPERCaSE ÅÄÖ") # FALSE
>
> Thanks for any input on how to create such a method.
> Leif
>
> Note: ÅÄÖ is swedish characters.
Just convert the string to all upper case and then check if the original
string and the all upper string are equal.
jue
------------------------------
Date: Sat, 28 Aug 2004 14:57:55 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: How to find out if a string is in uppercase only
Message-Id: <x7wtzj9upi.fsf@mail.sysarch.com>
>>>>> "BVdD" == Bart Van der Donck <bart@nijlen.com> writes:
BVdD> if ($_!~/(A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z)/)
BLARGGGHH!!
learn about char classes please. that is so slow and hard to
maintain.
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: Sat, 28 Aug 2004 15:12:38 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: How to find out if a string is in uppercase only
Message-Id: <Gh1Yc.338$bD5.275@trnddc03>
Bart Van der Donck wrote:
> You can extend the
> (A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z) part to include
> the Swedish characters that you want to allow. (or if you want spaces
> as in your example, etc)
Arrrg, if a developer would present this as a global solution to me I would
have a serious talk with his manager the same day!
This doesn't scale well to other languages because it requires detailed
knowlegde of the other language (or do you know which extended characters to
add for Spanish, Italian, or Turkish).
It doesn't scale well to other character sets (what are the capital letters
for cyrillic Serbian)? Do you as an English-speaking programmer know how to
enter them on your keyboard?
And it doesn't scale to additional language because it requires a code
change whenever you add a new language/character set.
Bad, bad, bad.
jue
------------------------------
Date: Sat, 28 Aug 2004 17:36:35 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: How to find out if a string is in uppercase only
Message-Id: <2pbncsFit5hpU1@uni-berlin.de>
Jürgen Exner wrote:
> This doesn't scale well to other languages because it requires
> detailed knowlegde of the other language (or do you know which
> extended characters to add for Spanish, Italian, or Turkish).
There is a separate charset for Turkish: ISO-8859-9 (which of course
emphasizes your point).
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: Sat, 28 Aug 2004 17:06:47 +0100
From: "Alan J. Flavell" <flavell@ph.gla.ac.uk>
Subject: Re: How to find out if a string is in uppercase only
Message-Id: <Pine.LNX.4.61.0408281653020.23576@ppepc56.ph.gla.ac.uk>
This message is in MIME format. The first part should be readable text,
while the remaining parts are likely unreadable without MIME-aware tools.
--616733697-1923161294-1093709207=:23576
Content-Type: TEXT/PLAIN; charset=ISO-8859-1
Content-Transfer-Encoding: 8BIT
On Sat, 28 Aug 2004, Gunnar Hjalmarsson wrote:
> Jürgen Exner wrote:
> > This doesn't scale well to other languages because it requires
> > detailed knowlegde of the other language (or do you know which
> > extended characters to add for Spanish, Italian, or Turkish).
>
> There is a separate charset for Turkish: ISO-8859-9 (which of course
> emphasizes your point).
The properly engineered way to do this in present-day Perl is to read
the characters into Perl's native wide-character storage format, and
then use the Unicode character property function(s).
However, the original question seemed to be based on the premise that
a white space character was upper-case, whereas from Unicode's point
of view it's not. And at least one of the answers was based on the
assumption that all characters which didn't exist in a lower-case
version were defined to be upper-case, which again isn't Unicode's
view of the world. The Original Poster will need to take a decision
on this issue.
The character properties are listed below here:
http://www.perldoc.com/perl5.8.4/pod/perlunicode.html#Effects-of-Character-Semantics
The Perl unicode documentation warns not to mix unicode with locales.
(So if there's any character which is considered uppercase in one
locale and not uppercase in another...?)
--616733697-1923161294-1093709207=:23576--
------------------------------
Date: Sat, 28 Aug 2004 18:07:30 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: How to find out if a string is in uppercase only
Message-Id: <CR3Yc.291$Gr2.225@trnddc07>
Gunnar Hjalmarsson wrote:
> Jürgen Exner wrote:
>> This doesn't scale well to other languages because it requires
>> detailed knowlegde of the other language (or do you know which
>> extended characters to add for Spanish, Italian, or Turkish).
>
> There is a separate charset for Turkish: ISO-8859-9 (which of course
> emphasizes your point).
There is even a separate charset for German: ISO-646-DE
Just nobody is using it which probably is a good thing ;-)
jue
------------------------------
Date: 28 Aug 2004 04:00:11 -0700
From: blackhole@diediedie.org (Andy Signer)
Subject: Re: How to unzip backup files of RaQ4 server?
Message-Id: <d416735.0408280300.4690526f@posting.google.com>
That's all-too-true ;-)
Thanks for the improvement!
Cheers
Andy
------------------------------
Date: Sat, 28 Aug 04 09:38:57 GMT
From: jmfbahciv@aol.com
Subject: Re: Larry Wall & Cults
Message-Id: <4130654c$0$19703$61fed72c@news.rcn.com>
In article <jdoherty-2708041631070001@192.168.2.178>,
jdoherty@nowhere.null.not (John Doherty) wrote:
>In article <412e199e$0$8076$a1866201@newsreader.visi.com>, Grant Edwards
><grante@visi.com> wrote:
>
>> On 2004-08-26, Randal L. Schwartz <merlyn@stonehenge.com> wrote:
>> > *** post for FREE via your newsreader at post.newsfeed.com ***
>> >
>> >>>>>> "Grant" == Grant Edwards <grante@visi.com> writes:
>> >
>> >Grant> "Guido said it, that settles it, but we're going to discuss
>> >Grant> it endlessly and and vote on it using six or seven
>> >Grant> different voting algorithms anyway. Then we'll argue about
>> >Grant> the voting algorithms."
>> >
>> > Are the voting algorithms indented consistently? That's a
>> > necessity, correct?
>>
>> Of course, but are they consistently indented using tabs or
>> spaces?
>
>AND HOW MANY SPACES PER TAB STOP?
Eight. Now talk about indenting skip returns...that one
required blood transfusions. [emoticon looks at list of n.g.]
I guess not many will understand.
/BAH
Subtract a hundred and four for e-mail.
------------------------------
Date: Sat, 28 Aug 2004 12:24:37 +0200
From: lepi <lepi_MAKNI_ME_@fly.srk.fer.hr>
Subject: Newbie Frontier::Daemon problem
Message-Id: <cgpmc1$ne0$1@bagan.srce.hr>
Hello,
Maybe this isn't the right place to ask this question, 'couse maybe it
has nothing to do with Frontier::RPC, but anyhow I will ask.
Question is about this example
http://xmlrpc-c.sourceforge.net/xmlrpc-howto/xmlrpc-howto-perl-server.html
I started it on one computer in my LAN, and tried client from the other
one. There is no firewalls. All the time I'm getting HTTP Error 403
-Forbidden on the client. I can't figure out why?? Maybe this is newbie
thing. :)
Anyhow, do I need web server on the computer where I'm running this
XMLRPC server?? (It is running on my computer) Is this program acting
like standalone server on port 8080 or it uses Apache (or something)???
Thank you
Tomislav
------------------------------
Date: 28 Aug 2004 08:27:53 -0700
From: minsanco@gmail.com (min)
Subject: pass 2d array to C function
Message-Id: <6570baab.0408280727.69ab3557@posting.google.com>
I need to call a C function from perl. How do I pass a 2D array into
the C function that I am invoking from perl? Can anyone direct me to
a tutorial?
Thanks!
------------------------------
Date: 28 Aug 2004 10:38:25 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: performance surprise -- why?
Message-Id: <cgpnb1$pve$1@mamenchi.zrz.TU-Berlin.DE>
Abigail <abigail@abigail.nl> wrote in comp.lang.perl.misc:
> Anno Siegel (anno4000@lublin.zrz.tu-berlin.de) wrote on MMMMXIV September
> MCMXCIII in <URL:news:cgntnp$p51$1@mamenchi.zrz.TU-Berlin.DE>:
> ;; Uri Guttman <uri@stemsystems.com> wrote in comp.lang.perl.misc:
> ;; > >>>>> "A" == Abigail <abigail@abigail.nl> writes:
> ;;
> ;; ["use English" causes regex slowdown]
[...]
> ;; Another option would be to conserve the documented behavior, so that
> ;; the speed penalty only occurs when $MATCH, etc. are used. One could
> ;; tie them first, so they only alias (and untie) themselves on first
> ;; usage. I don't particularly care to work out the details (a simple-
> ;; minded attempt didn't work immediately), but I'm sure it can be done.
>
> That wouldn't work. $& etc can only work if work is done when the
Not sure what you are saying here...
> match occurs - if you delay it till $& is actually used, the necessary
> information is gone. That's why the penalty occurs if the *compiler*
> detect $&, not the runtime.
...but the meaning is clear: The regex engine must know it is expected
to save all matches when the match occurs. It won't do to tell it after-
wards. Pretty obvious, put that way.
> Witness:
[demo snipped]
So much for that idea. Thanks for shooting it down. Back to
deprecating "English", then :)
Anno
------------------------------
Date: Sat, 28 Aug 2004 10:18:54 GMT
From: bowsayge <bowsayge@nomail.afraid.org>
Subject: Re: using the result of a variable regular expression
Message-Id: <i_YXc.2454$6o3.113@newsread2.news.atl.earthlink.net>
Brian McCauley said to us:
>> Interesting question. As pointed out, $$numb will work nicely for you.
>
> For certain values of "nice".
>
[...]
Bowsayge hopes that this is a better value of "nice":
'8 t 4' =~ /(\d) (\w) (\d)/;
my $numb = 3;
print "matched: ", eval("\$$numb"), "\n";
There is no need to enable sym-refs.
--
my (@str) = split //,'eitrhbe ta.Jw eonerl snpu';
my (@ndx, @arr) = qw(19 22 3 15 9 21 14 17 8 5 24 0 20
4 23 7 18 10 11 16 12 2 6 13 1);
@arr[ @ndx ] = @str; print @arr, "\n";
------------------------------
Date: Sat, 28 Aug 2004 12:21:53 +0100
From: Brian McCauley <nobull@mail.com>
Subject: Re: using the result of a variable regular expression
Message-Id: <cgppsh$tbp$1@slavica.ukpost.com>
bowsayge wrote:
> Brian McCauley said to us:
>
>
>>>Interesting question. As pointed out, $$numb will work nicely for you.
>>
>>For certain values of "nice".
>>
>
> [...]
>
> Bowsayge hopes that this is a better value of "nice":
>
> '8 t 4' =~ /(\d) (\w) (\d)/;
> my $numb = 3;
> print "matched: ", eval("\$$numb"), "\n";
>
> There is no need to enable sym-refs.
All the reasons to avoid symrefs bad also apply to eval(STRING), only
more so.
------------------------------
Date: 28 Aug 2004 11:22:57 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: using the result of a variable regular expression
Message-Id: <cgppuh$s6j$1@mamenchi.zrz.TU-Berlin.DE>
bowsayge <bowsayge@nomail.afraid.org> wrote in comp.lang.perl.misc:
> Brian McCauley said to us:
>
> >> Interesting question. As pointed out, $$numb will work nicely for you.
> >
> > For certain values of "nice".
> >
> [...]
>
> Bowsayge hopes that this is a better value of "nice":
Not really.
> '8 t 4' =~ /(\d) (\w) (\d)/;
> my $numb = 3;
> print "matched: ", eval("\$$numb"), "\n";
>
> There is no need to enable sym-refs.
Sure. You can re-write any symref unsing eval like that, so string
eval is the more general mechanism. It also allows Perl to break its own
rules in more ways than mere symrefs do, so it's higher in the hierarchy
of nastiness, not lower.
It is also ugly because it's disproportionate, in the way it would be
ugly to start a sawmill to make a toothpick from a twig. You are running
another Perl interpreter to interpret a program that reads "$1" or "$5" or
something.
That said, your solution is, of course, perfectly valid. The symref
solution needs to unexpectedly talk about "strict", and may need a
bare block to limit the effect. So "eval" is shorter and more to the
point, and it's arguably as readable. Since the string you eval is
entirely defined in the program text (as opposed to an external source),
there is no additional risk in "eval".
But "nicer", no.
Anno
------------------------------
Date: Sat, 28 Aug 04 10:30:03 GMT
From: jmfbahciv@aol.com
Subject: Re: Xah Lee's Unixism
Message-Id: <41307146$0$19703$61fed72c@news.rcn.com>
In article <cgp2u4$5nk$1@nntp.webmaster.com>,
"David Schwartz" <davids@webmaster.com> wrote:
>
><ctcgag@hotmail.com> wrote in message
>news:20040827135423.154$1T@newsreader.com...
>
>> "David Schwartz" <davids@webmaster.com> wrote:
>
>>> I don't follow you at all. I think you'll find the most useful,
>>> meaningful complaints about, say, a Ford Explorer from the people who
>>> drive one every day.
>
>> And if they continue to drive one everyday, perhaps you would conclude
>> that their complaints are insincere.
>
> That's a load of crap.
Sigh! Another one who has no appreciation of irony.
/BAH
Subtract a hundred and four for e-mail.
------------------------------
Date: Sat, 28 Aug 2004 14:55:37 +0000 (UTC)
From: Andre Majorel <amajorel@teezer.fr>
Subject: Re: Xah Lee's Unixism
Message-Id: <slrncj1745.t5q.amajorel@atc5.vermine.org>
On 2004-08-28, Rob Warnock <rpw3@rpw3.org> wrote:
> Pascal Bourguignon <spam@mouse-potato.com> wrote:
> +---------------
>| $ telnet xahlee.org 80;
>| Trying 208.186.130.4...
>| Connected to xahlee.org.
>| Escape character is '^]'.
>| GET / HTTP/1.1
>|
>| HTTP/1.1 400 Bad Request
>| Date: Fri, 27 Aug 2004 01:35:52 GMT
>| Server: Apache/2.0.50 (Fedora)
>| ^^^^^^^^^^^^^^^^^^^^^^
> +---------------
>
> So are you complaining about the fact that his hosting provider
> preloaded RedHat Fedora with Apache 2.0 for him?
There is no shortage of Windows-based hosting companies, so why
didn't he go there ? Whatever your opinions, it's best to put
your money where your mouth is if you expect to be taken
seriously.
--
André Majorel <URL:http://www.teaser.fr/~amajorel/>
"See daddy ? All the keys are in alphabetical order now."
------------------------------
Date: Sat, 28 Aug 2004 15:16:36 +0000 (UTC)
From: Ian Wilson <scobloke2@infotop.co.uk>
Subject: Re: Xah Lee's Unixism
Message-Id: <cgq7ki$eg1$1@hercules.btinternet.com>
David Schwartz wrote:
> <ctcgag@hotmail.com> wrote in message
> news:20040827135423.154$1T@newsreader.com...
>
>
>>"David Schwartz" <davids@webmaster.com> wrote:
>
>
>>> I don't follow you at all. I think you'll find the most useful,
>>>meaningful complaints about, say, a Ford Explorer from the people who
>>>drive one every day.
>
>
>>And if they continue to drive one everyday, perhaps you would conclude
>>that their complaints are insincere.
>
>
> That's a load of crap.
>
> DS
>
>
You're both right but ...
Xah Lee: "I'm starting my own cult to exterminate morons on
this earth. Two things are on the top of my agenda: Unixism and Perl."
Pascal Bourguignon: <Xah Lee's website runs on Linux, a Unix-like OS>
Is more like
Joe Blow: I'm going to exterminate all morons who drive a Ford Explorer.
Fred Bloggs: But Joe, you drive a Ford Explorer!
Rather than
Joe Blow: Ford Explorers are a little bit expensive to service and the
doors squeak after a couple of years.
Fred Bloggs: Thanks for the tip Joe, I see you drive one, so you should
know.
------------------------------
Date: 28 Aug 2004 18:05:47 +0200
From: Pascal Bourguignon <spam@mouse-potato.com>
Subject: Re: Xah Lee's Unixism
Message-Id: <87llfzqmck.fsf@thalassa.informatimago.com>
Ian Wilson <scobloke2@infotop.co.uk> writes:
> David Schwartz wrote:
>
> > <ctcgag@hotmail.com> wrote in message
> > news:20040827135423.154$1T@newsreader.com...
> >
> >>"David Schwartz" <davids@webmaster.com> wrote:
> >
> >>> I don't follow you at all. I think you'll find the most useful,
> >>>meaningful complaints about, say, a Ford Explorer from the people who
> >>>drive one every day.
> >
> >>And if they continue to drive one everyday, perhaps you would conclude
> >>that their complaints are insincere.
> > That's a load of crap.
> > DS
> >
>
>
> You're both right but ...
>
> Xah Lee: "I'm starting my own cult to exterminate morons on
> this earth. Two things are on the top of my agenda: Unixism and Perl."
>
> Pascal Bourguignon: <Xah Lee's website runs on Linux, a Unix-like OS>
>
>
> Is more like
>
> Joe Blow: I'm going to exterminate all morons who drive a Ford Explorer.
>
> Fred Bloggs: But Joe, you drive a Ford Explorer!
>
>
> Rather than
>
> Joe Blow: Ford Explorers are a little bit expensive to service and the
> doors squeak after a couple of years.
>
> Fred Bloggs: Thanks for the tip Joe, I see you drive one, so you
> should know.
Case closed. (And probably Xah has suicidal impulses).
--
__Pascal Bourguignon__ http://www.informatimago.com/
Our enemies are innovative and resourceful, and so are we. They never
stop thinking about new ways to harm our country and our people, and
neither do we.
------------------------------
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 6925
***************************************