[11070] in Perl-Users-Digest
Perl-Users Digest, Issue: 4670 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Jan 16 17:04:12 1999
Date: Sat, 16 Jan 99 14:00:18 -0800
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, 16 Jan 1999 Volume: 8 Number: 4670
Today's topics:
A plea for less goofy signature files! <new_email@see.web.page>
Re: A plea for less goofy signature files! (Snowhare)
Re: ASIA FRIENDs FINDER <mlabor@sprintmail.com>
Re: calling a subroutine with variables <njones@firstquadrant.com>
Re: CONCLUSIVE PROOF: The Beatles are bigger than Jesus dturley@pobox.com
Re: grep question (Tad McClellan)
Re: grep question (Tad McClellan)
Re: Looking for CGI modules <eugene@snailgem.org>
Re: Looking for free Web Server with CGI <njones@firstquadrant.com>
None ("godwin prakash")
Re: Perl and LDAP (Mads Toftum)
Re: Perl Criticism topmind@technologist.com
Re: Perl Criticism topmind@technologist.com
Re: Perl Criticism topmind@technologist.com
Re: Perl Criticism topmind@technologist.com
Perl/CGI programmer needed in Virginia (Garry D. Qualls)
Re: Regex challenge <njones@firstquadrant.com>
Re: Secuity hole with perl (suidperl) and nosuid mounts (Ilya Zakharevich)
Re: Syntax help wanted: "use strict" and sort $a and $ (William Herrera)
Re: Treating Strings as FILEHANDLES <rick.delaney@home.com>
Win98 Perl? <jhobbs@cwix.com>
Re: Win98 Perl? <ijp@thornlea.force9.co.uk>
Re: Win98 Perl? <allan@due.net>
Re: Win98 Perl? (Matthew Bafford)
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 16 Jan 1999 11:08:46 PST
From: "Phlip" <new_email@see.web.page>
Subject: A plea for less goofy signature files!
Message-Id: <77qo3u$lq7@journal.concentric.net>
Newsgroupies
Perl users, for some reason moreso than for other languages, like to
invent strings of nonsense that vaguely resemble source code and put
them in their signature files, like this:
(open 0),$_=<0>,s,.*-+ ,,,chop;for(split?@*?){($$_++or$}=$_,y,
y \,y,<STDIN>,,eval"sub $_ {print'$}'}"),y,} \,},>STDOUT,,&$_}
That practice is not in the Open Source Software movement's best
interests.
"The Cause" - beating the commercial idiots at their own game, in
our spare time, and for free - depends on the QA format of public
fora to answer questions which are then warehoused; in DejaNews or
in each list server's archives. But signature files like this jam
the search engines with smug false hits!
-- Phlip at politizen dot com (address munged)
======= http://users.deltanet.com/~tegan/home.html =======
------------------------------
Date: Sat, 16 Jan 1999 19:38:47 GMT
From: snowhare@devilbunnies.org (Snowhare)
Subject: Re: A plea for less goofy signature files!
Message-Id: <bV5o2.6369$yt4.21067@typhoon-sf.pbi.net>
Nothing above this line is part of the signed message.
In article <77qo3u$lq7@journal.concentric.net>,
Phlip <new_email@see.web.page> wrote:
>Newsgroupies
>
>Perl users, for some reason moreso than for other languages, like to
>invent strings of nonsense that vaguely resemble source code and put
>them in their signature files, like this:
>
> (open 0),$_=<0>,s,.*-+ ,,,chop;for(split?@*?){($$_++or$}=$_,y,
> y \,y,<STDIN>,,eval"sub $_ {print'$}'}"),y,} \,},>STDOUT,,&$_}
>
>That practice is not in the Open Source Software movement's best
>interests.
>
>"The Cause" - beating the commercial idiots at their own game, in
>our spare time, and for free - depends on the QA format of public
>fora to answer questions which are then warehoused; in DejaNews or
>in each list server's archives. But signature files like this jam
>the search engines with smug false hits!
Have you ever tried *running* one of those signatures (hint1)?
Doing searches on keywords from computer languages is stupid
anyhow (hint2) - you will get virtually nothing but out of
context source code fragments and mis-hits on common english
words (which oddly are used a lot in computer languages).
my $name=join('',reverse(split(//,'Benjamin "Snowhare" Franz')));
$_='024e046b794c446f25423a6375477d6c14450a39447a07637e';
s/(..)/push(@ARGV,hex($1))/eg;while($_=chop $name){
$_=ord^shift;$_+=$a;$_%=108;print chr(($a=$_)+10)}
Version: 2.6.2
iQCVAwUBNqDrOejpikN3V52xAQHrugP/Xm26GlaCTiNrPlRdon/Bn9M3lV208Udr
sZCMR9qNUKDi6NvyqYF6b3lqrCsKtQkAJDxW2O3b5AWpnSf/1/cIwpTmY1Tq18oj
Wr5IBT2rttfYN54s5WlA77n6EjiCc8c8mRWIGWcTTXoO+Tt1eKZn8VoLNhIM7Rii
J9yIOhzeOdk=
=qdoL
-----END PGP SIGNATURE-----
------------------------------
Date: Sat, 16 Jan 1999 15:49:04 -0500
From: "Manual Labor" <mlabor@sprintmail.com>
Subject: Re: ASIA FRIENDs FINDER
Message-Id: <77qtvq$s01$1@ash.prod.itd.earthlink.net>
This is a multi-part message in MIME format.
------=_NextPart_000_0016_01BE4167.BE89EE60
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
try reading the manuals first
ie. perldoc -f sexmongers
hth
------=_NextPart_000_0016_01BE4167.BE89EE60
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN">
<HTML>
<HEAD>
<META content=3Dtext/html;charset=3Diso-8859-1 =
http-equiv=3DContent-Type><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 =
Transitional//EN">
<META content=3D'"MSHTML 4.71.1712.3"' name=3DGENERATOR>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT color=3D#000000 size=3D2>try reading the manuals =
first</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT> </DIV>
<DIV><FONT size=3D2>ie. perldoc -f sexmongers</FONT></DIV>
<DIV><FONT size=3D2></FONT> </DIV>
<DIV> </DIV>
<DIV><FONT size=3D2>hth</FONT></DIV>
<BLOCKQUOTE=20
style=3D"BORDER-LEFT: #000000 solid 2px; MARGIN-LEFT: 5px; PADDING-LEFT: =
5px">
<DIV> </DIV></BLOCKQUOTE></BODY></HTML>
------=_NextPart_000_0016_01BE4167.BE89EE60--
------------------------------
Date: Sat, 16 Jan 1999 11:40:25 -0800
From: Neil Jones <njones@firstquadrant.com>
To: Andy Kaplan <andrew.kaplan@yale.edu>
Subject: Re: calling a subroutine with variables
Message-Id: <36A0EB29.CDBD362E@firstquadrant.com>
Howsabout:
foreach $var (@variables) {
$var->(@arguments);
}
?
Or, if your subroutines are named lke "firstsubroutine", "secondsubroutine" and
@variables contains "first", "second", you can
foreach $var (@variables) {
&{ "${var}subroutine" }( @arguments );
}
? Roughly the same as above, only not as pretty.
But, better yet would be to put function references into @variables:
@variables = (
\&first,
\&second,
# ..
);
instead of "soft references". And then get it all in one fell swoop:
map { $_->(@args) } @variables;
HTH
BTW -- check the perl manual about references. It's pretty handy.
..Neil
Andy Kaplan wrote:
> Hi,
>
> I'm not exactly a newbie at Perl, but I am self-taught and I know that there
> are gaping holes in my knowledge. Still, I've gotten pretty far with it I'd
> say, so I don't think my question is trivial. I have looked through the
> entire faq for something related, but can't find it:
>
> Basically, I want to use a variable to call a subroutine.
>
> That is, I have,
> @variables = ("first", "second");
>
> And I have two subroutines, firstroutine and secondroutine. What I want is
> something like this:
>
> foreach $variable (@variables) {
> if ($variable eq "first") {
> &$variableroutine;
> }
> }
>
> See? I want it to figure out the name of the appropriate subroutine on its
> own. Obviously, if my situation were as simple as above I would just call
> the subroutine directly but believe me, I can't do it that way. I only have
> access to variables, and I want it to be general enough to figure out the
> right subroutine on its own.
>
> How can I do this with Perl?
>
> Any help is greatly appreciated!
> -Andy
>
> Andrew Kaplan-Myrth
> email: andrew.kaplan@yale.edu
> ICQ Pager: http://i.am/kaplanmyrth
------------------------------
Date: Sat, 16 Jan 1999 18:57:51 GMT
From: dturley@pobox.com
Subject: Re: CONCLUSIVE PROOF: The Beatles are bigger than Jesus!
Message-Id: <77qnfb$s5h$1@nnrp1.dejanews.com>
In article <369FDE88.3E75@roundtrip.net>,
joemama@roundtrip.net wrote:
> -BEN wrote:
>
> > JLenn wrote:
>
<CLIPPED>
> ---
> To reply no spam, change "roundtrip" to "rarebird"
> cuz for the spam it's gonna be a literal round trip..
So worried about spam, yet he's posting this totally off-topic drivel to a
Perl newsgroup.
Geez!
(Remembering that half the world is below average intelligence.)
____________________________________
David Turley
dturley@pobox.com
http://www.binary.net/dturley/
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Sat, 16 Jan 1999 12:08:19 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: grep question
Message-Id: <jikq77.emn.ln@magna.metronet.com>
Robert Gwynne (gwynne@utkux.utk.edu) wrote:
: Would someone please explain how the following construction works.
Sure.
: %FIELDS = ('Personal
: Information'=>['Name','Address','Telephone','Fax'],
: 'References'=>['Personal Ref 1', 'Personal
: Ref 2']
: );
Something strange has happened to your code (word wrapped)...
: foreach (values %FIELDS){
loop executes 2 times because there are two values in the hash
$_ is a reference to an anonymous array
: grep($ALL_FIELDS{$_}++, @$_);
$ALL_FIELDS{$_}++ counts occurrences of elements in the anon array
@$_ dereferences the reference to an anonymous array held in $_
Using grep() and ignoring what it returns is krufty (note that
the FAQ examples actually make use of what grep() returns).
The Author is using a grep() for a foreach().
Better to just use a foreach() for a foreach() ;-)
You can replace the grep() above to get the same results:
foreach (@$_) { $ALL_FIELDS{$_}++ }
^^ ^^
Those are _different_ variables.
The first is an array reference, the second is a localized 'alias'
to elements of the anon array (scalar strings in this case).
: }
: The above is from p. 71 of Official Guide to Programming with CGI.pm. The
: grep function is the part that I don't understand.
That's OK, as it is being abused there.
You should understand it just enough to realize that it is
not The Right Tool For The Job ;-)
: I understand grep in
: general, but not this specific instance. I can't print $ALL_FIELDS because I
: get an uninitialized value error.
You don't have a scalar $ALL_FIELDS variable, so that message
is correct.
You do have a %ALL_FIELDS hash variable there though.
print "counts of the strings found:\n";
foreach (sort keys %ALL_FIELDS) {
print "$_: $ALL_FIELDS{$_}\n";
}
$ALL_FIELDS{$_} is a *scalar* element in the hash.
$ is used for scalars (even when the scalar is contained within
some other data structure).
%ALL_FIELDS is the entire hash, not one particular element.
: Just using "print" to print the value(s)
: prints hex values.
You didn't give us the code for that part, so we really can't give
the definitive answer...
I'm guessing that you are printing _references_ though, which
are not very interesting or useful.
You should dereference them to get to the useful stuff.
: Similar constructions are found in the FAQ, but are not broken down so that
: newbies (at least this one) can understand them, e.g.,
OK.
I'll try explaining one of those too.
: b) If you don't know whether @in is sorted:
: undef %saw;
: @out = grep(!$saw{$_}++, @in);
@out = grep( # grep returns a list of elements for which the
# expression is "true". The list elements are
# saved into the @out array
!$saw{$_}++, # this is the expression that determines whether
# a particular array element will be returned
# by the grep()
@in # a list of elements to test with the expression
);
$saw{$_} is a count of how many have been seen so far
++ adds one to the count to account for the one currently being tested
! negates the sense of the expression
So in English, !$saw{$_}++
returns "true" if the value in $_ has not been seen previously
: I would like to know EXACTLY what is going on here so that I can ultimately
: understand it. I know what it does, I want to know how & why it does what it
: does.
Did that do it?
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Sat, 16 Jan 1999 13:28:12 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: grep question
Message-Id: <c8pq77.v5o.ln@magna.metronet.com>
I myself (tadmc@metronet.com) wrote:
: foreach (@$_) { $ALL_FIELDS{$_}++ }
: ^^ ^^
: Those are _different_ variables.
Uhh.
Actually those are the same variable.
They just have different values in each place, due to how
local() works.
: The first is an array reference, the second is a localized 'alias'
: to elements of the anon array (scalar strings in this case).
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Sat, 16 Jan 1999 16:39:19 -0500
From: Eugene Sotirescu <eugene@snailgem.org>
To: spadesmcgee@my-dejanews.com
Subject: Re: Looking for CGI modules
Message-Id: <36A10707.B6104898@snailgem.org>
spadesmcgee@my-dejanews.com wrote:
>
> Hi all,
>
> I'm writing some really simple CGI scripts, that return HTML and send emails.
> No biggie.
>
> I did all this 4-5 years ago or so, and haven't used Perl since. Since then it
> seems like a lot has changed, esp as far as available packages (I used Perl 4
> and have never really used modules or any of the Perl OOP stuff). I'm guessing
> there are modules available for what I want to do (it's only been done like a
> billion times), but where do I start
http://www.perl.com
http://www.smithrenaud.com/public/CGI_MetaFAQ.html
--
Eugene
you: "I have a gun. Give me your money!"
Eliza: "Can you elaborate on that?"
(from a conversation with the chatbot Eliza, as reported by John Nolan)
------------------------------
Date: Sat, 16 Jan 1999 11:10:20 -0800
From: Neil Jones <njones@firstquadrant.com>
To: Chris <chrisl@hamptons.com>
Subject: Re: Looking for free Web Server with CGI
Message-Id: <36A0E41C.5E8BE45@firstquadrant.com>
Probably Apache from http://www.apache.org. Also get perl.
Chris wrote:
> Hi
>
> Are there any free Web servers for Win98 (even trial versions) that
> allow me to mess around with CGI & Perl? Last time I tried this (years
> ago), PWS was supposed to do it but it was broken (or I was broken, or
> something)
>
> Thanks,
> Chris
------------------------------
Date: Sat, 16 Jan 1999 10:20:57 PST
From: godwinasp@hotmail.com ("godwin prakash")
Subject: None
Message-Id: <19990116182057.20866.qmail@hotmail.com>
HI all,
I have an doubt in split command (ie) while i was trying to split an
text file with an referance say (;) and print it in seperate line which
are preceeding ";" i was able to get splited only once (ie) to
seperate lines.it was not able to split above that.
please let me know how would i split all the (;)in an text file and
store in an seperate lines
thank you
Godwin
______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com
------------------------------
Date: Sat, 16 Jan 1999 18:42:51 GMT
From: mt@dev.null (Mads Toftum)
Subject: Re: Perl and LDAP
Message-Id: <36a1dc47.50674421@news.inet.tele.dk>
On Fri, 15 Jan 1999 22:44:11 GMT, richard.motley@lmco.com wrote:
>How would I go about using the simple authentication feature of PerLDAP to
>validate users of a website. I have an ACL presently, and have exported the
>users to an LDIF file. This is as far as I have gotten, other than building
>the PerLDAP and testing items such as a simple user verification through a
>command prompt. Here is a sample of what I have done:
If you could switch to Apache that problem could be solved very
easily. There's already a couple of standard modules that does LDAP
auth. And there is also the mod_perl version called: Apache::AuthLDAP
To see examples of other ways to do auth in mod_perl check
http://www.modperl.com/chapters/ch6.html - these should give you a
general idea about how to handle auth in mod_perl and with that it
really shouldn't be that hard to do your own module.
vh
Mads Toftum, QDPH
som pe USENET reprfsenterer sig selv og ingen andre.
------------------------------
Date: Sat, 16 Jan 1999 20:40:33 GMT
From: topmind@technologist.com
Subject: Re: Perl Criticism
Message-Id: <77qtg0$1c4$1@nnrp1.dejanews.com>
In article <369f5fa8.2780852@news.skynet.be>,
bart.lateur@skynet.be (Bart Lateur) wrote:
> topmind@technologist.com wrote:
>
> >> >> Anyway, that's how *I* found Perl, Python and TCL, more than 5 years
> >> >> ago. They weren't the "hot items" then. Funny how my preferences of that
> >> >> time eventually made it into popularity...
> >> >>
> >> >> Bart.
> >> >
> >> >You should have bought stocks intead, then you would not
> >> >need ANY language :-)
> >>
> >> You can buy stockes in perl?
> >
> >I meant use your alleged gift at prediction to make
> >money picking the winners (growth markets) in general.
>
> Hey, I didn't say I thought it would *sell*. I still doubt, even now,
> whether most users would be prepared to pay, say, 150$ for their first
> Perl package.
>
> But the fact that quite of few of my favorites were picked up, may well
> indicate that quite a few people want pretty much the same thing from a
> computer language as I do:
>
> 1) Simple, so you don't have to try too hard to remember how to work
> with it (or, as in Perl, with a workable subset of it).
Simple to write, but may not be to read if you pick up the
code of a proud cryptologist.
> 2) Powerful. I hate to bump into relatively simple problems, where the
> only reply is "you can't do that".
> 3) Redundancy. I hate redundancy. And verbosity. Having to type the
> header line of functions twice, or the necessity for elaborate
> declarations for relatively brainless stuff, those things really turn me
> off.
>
That is what my suggested "@" operator is for.
It can be used for any function, and it is clear
which parameter it uses.
Can Perl's "=~" be used for any function? Where's my
book?
> Also:
> 4) Lack for risk for subtle bugs. Things that blow up in your face,
> without much of an apparent reason. See the running advertisements for
> PC-Lint in DDJ, and you'll see part of why C isn't in my favorites list.
Perl can get somewhat funky too.
It has referants (pointers) for example.
It is true that they are less "memory-tied" than C, but
pointers are archaic constructs with no useful purpose other
than raw speed.
> 5) Interactivity. Ease of testing and debugging. A fast turnaround
> (edit/compile/run) cycle is desirable.
> 6) Lightweight and fast. I really hate IDE's that take minutes to
> launch and take up all the available computer resources. And, if simple
> compiled programs take megabytes of disk space and/or memory, or are
> remarkably slow, then I won't use it too much, no matter how I like the
> language. Sorry.
That is what happens without competition.
>
> Bart.
>
http://www.geocities.com/SiliconValley/Lab/6888/langopts.htm
-tmind-
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Sat, 16 Jan 1999 20:46:38 GMT
From: topmind@technologist.com
Subject: Re: Perl Criticism
Message-Id: <77qtrc$1ig$1@nnrp1.dejanews.com>
In article <slrn79se7t.lmc.dformosa@godzilla.zeta.org.au>,
dformosa@zeta.org.au (David Formosa (aka ? the Platypus)) wrote:
> In article <77kusq$kh$1@nnrp1.dejanews.com>, droby@copyright.com wrote:
> >In article <slrn79lm8o.mtj.dformosa@godzilla.zeta.org.au>,
> > dformosa@zeta.org.au (David Formosa (aka ? the Platypus)) wrote:
>
> [...]
>
> >> Then have your boolean equility operator called "eq" then.
I guess this could be considered, but it is a bit harder to
read than the symbols and less familiar. I shall put it in
the next revision, okay?
(I can't find the original message for this.)
> >>
> >
> >Or get an APL keyboard and use left-arrow for assignment. Or emulate Algol
> >and use := for assignment.
>
But people who use a lot of languages will keep forgetting
the ":" and accidently make them booleans.
> And then you can use the operator :=: to swap its arguments.
>
> --
> Please excuse my spelling as I suffer from agraphia. See
> http://www.zeta.org.au/~dformosa/Spelling.html to find out more.
> How to win arguments on usenet http://www.zeta.org.au/~dformosa/usenet.html
>
>
-tmind-
http://www.geocities.com/SiliconValley/Lab/6888/langopts.htm
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Sat, 16 Jan 1999 20:52:56 GMT
From: topmind@technologist.com
Subject: Re: Perl Criticism
Message-Id: <77qu74$1uf$1@nnrp1.dejanews.com>
In article <77l7kc$8mj$1@nnrp1.dejanews.com>,
tiptopmind@my-dejanews.com wrote:
Why are some of you trying to slam me personally?
Fortunately, I am perfectly able to defend my opinions
and enjoy debates, but only from PEOPLE WHO LOOK
AT THE IDEA INSTEAD OF TRYING TO SLANDER SOMEBODY
PERSONALLY.
It is a shame that sick people like you roam the
web. I bet you are a professional spammer or hack
for living. How many credit cards number have you
stolen you sick creap! Sick intentions from
sick people.
> In article <77hgnn$1u2$1@nnrp1.dejanews.com>,
> topmind@technologist.com wrote:
>
> >GO TO HELL YOU SICK, LYING CREEP!!!!!!!!!
>
> Now that is not nice.
>
> Sounds like something Howard Stern might say. Are you a big Howard fan top?
> I know you are interested in UFO's so you must be fascinated with
> coincidences too. Here is an interesting one.
>
> A Bryce Jacobs has a homepage devoted to Howard Stern at
> http://ourworld.compuserve.com/homepages/nerdwod/
> where he also complains that that his wife gives him grief about the size of
> his stomach.
>
> On the home page there is link to a UFO page (containing some javascript
> errors). The link points to:
> http://www.geocities.com/Area51/Corridor/5004/ufobs.htm
> which includes the the email address:
> .....
> .....
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Sat, 16 Jan 1999 21:01:11 GMT
From: topmind@technologist.com
Subject: Re: Perl Criticism
Message-Id: <77qumi$2da$1@nnrp1.dejanews.com>
In article <77l5as$6hj$1@nnrp1.dejanews.com>,
droby@copyright.com wrote:
> In article <77hhmt$2om$1@nnrp1.dejanews.com>,
> topmind@technologist.com wrote:
>
> > > Many computer scientists have fallen into the trap of trying to define
> > > languages like George Orwell's Newspeak, in which it is impossible to
> > > think bad thoughts. What they end up doing is killing the creativity
> > > of programming.
> > > -- Larry Wall
> >
> > Well then I have to disagree with Larry Wall a bit. For one
> > he assumes that creativity and cryptology are one in the same.
>
> Not. Creativity is needed for cryptology but not vice-versa. Choices are
> needed for creativity, and one of the virtues of Perl is, as I'm sure you've
> heard, "There's more than one way to do it." Your insistence on taking out
> everything that might be dangerous in the hands of an idiot will lead to a
> language in which idiots can program as well as geniuses and neither can
> easily accomplish much that's very useful
>
I challenged you to show me an example of code that would be
"notorious" without Perl's abusability. Nobody has found
any yet.
(I bet they do exist, but are rare and do not justify
abusable syntax.)
Perhaps there are cases where a loop would have to
be explicit instead of implicit, or something might take up
5 lines instead of 2, but overall, the readability will be
improved manyfold.
> > Second, I aim to fix the worst 3rd, not the middle or the top.
> >
> > Actually, I seem to fall somewhere in between the OOPers who
> > are anal about protecting everything, and Perlers who think
> > saving keystrokes is the ultimate goal.
> >
>
> Perlers who think saving keystrokes is the ultimate goal? Where? Any of you
> guys think that?
>
Then what is their goal exactly?
> --
> Don Roby
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
>
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Sat, 16 Jan 1999 21:07:26 GMT
From: NO-SPAMgqualls@exis.net (Garry D. Qualls)
Subject: Perl/CGI programmer needed in Virginia
Message-Id: <NO-SPAMgqualls-1601991606340001@cx45214-a.nwptn1.va.home.com>
Looking for a solid Perl/CGI programmer to join an ongoing development
project as a NASA contractor. Experience with UNIX, LWP, C/C++, OGL, GD,
ImageMagick, VRML2, HTML, Photoshop, Javascript, or JAVA will help but are
not strictly required. This is a full-time position. Job would require
working on-base at NASA's Langley Research Center in Hampton, Virginia.
An overview page for the project may be seen here:
http://vab02.larc.nasa.gov/IDS4
Responsibilities will include, among other things, porting the current
framework capabilities into the MUSE virtual reality environment and
cleaning the CGI scripts up enough for public release under an "open
source" software license.
replies to:
NO-SPAMgqualls@exis.net
(remove NO-SPAM from that email address to get it to work)
------------------------------
Date: Sat, 16 Jan 1999 12:12:26 -0800
From: Neil Jones <njones@firstquadrant.com>
To: eric@nafex.com
Subject: Re: Regex challenge
Message-Id: <36A0F2AA.C3628FC3@firstquadrant.com>
> 2) I want to march a lower case, upper case or mixed word and _replace_ it
> with the same case layout in the new word
This should officially be dubbed the "dumb" method:
s/(\w+) becomes (\w+)/translate(\1,\2)/e; # or however you want to call it...
sub translate {
my ($old, $new) = @_;
my (@old, @new);
@old = split // => $old;
@new = split // => $new;
warn("$old and $new are of different lengths\n"), return unless @old ==
@new;
return pack("c*", map { ord($new[$_]) + ord($old[$_]) -
ord(lc($old[$_])) } 0..@new);
}
..Neil
------------------------------
Date: 16 Jan 1999 20:54:51 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Secuity hole with perl (suidperl) and nosuid mounts on Linux
Message-Id: <77quar$5c0$1@mathserv.mps.ohio-state.edu>
[A complimentary Cc of this posting was sent to Peter Samuelson
<psamuels@sampo.creighton.edu>],
who wrote in article <77q068$ht8$1@nemesis.niar.twsu.edu>:
> Just after posting I realized that these checks by the kernel can be
> easily circumvented by not having the kernel do the #! processing.
> Just run `perl' or `suidperl' on the executable and it will duplicate
> the kernel permission checks, including setuid bits, only it doesn't
> duplicate them well enough. I just now tested this on a loopback
> filesystem and it is definitely exploitable.
>
> Brian, you're right, I'm wrong. This needs to be fixed. Now. (I'm
> running Debian Linux 2.1 "slink" which features perl 5.004_04.)
Somehow I'm lost on this description (I have seen Linux several times,
but have no idea how perms in a removable media can work).
Did I understand it correct: you chown/set-suid script.pl while it is
in your laptop, insert it in a server floppy, and run user-level perl
on it and it bombs? How so?
Ilya
------------------------------
Date: 16 Jan 1999 18:43:33 GMT
From: posting.account@lynxview.com (William Herrera)
Subject: Re: Syntax help wanted: "use strict" and sort $a and $b parameters...
Message-Id: <dM33c2i67iQd-pn2-SI2W8TWoFEXS@cheetah>
On Sat, 16 Jan 1999 13:00:57, mjtg@cus.cam.ac.uk (M.J.T. Guy) wrote:
> >However, it also does not handle command line globbing of filename
> >wildcards as my old 5.001 binaries did (or as the Solaris one does).
>
> Eh? Globbing may have some rough edges, but it should work in that
> version of Perl. Can you give an example program (preferably short)
> which works in 5.001 but not 5.004+ ?
if the program "perl -w test.pl *.txt"
is run, where the default directory contains "1.txt" and "2.txt" and
test.pl
looks like:
#
print @ARGV;
#
my version on Win32 of perl 5.001 will print 1.txt2.txt
and 5.004 prints *.txt
I think this reflects the underlying DOS OS and the differing
compilers used for the source. I have Watcom C for DOS/WIN/OS2, which
only supports wildargs type wildcard expansion of argv under vanilla
DOS :(.
my workaround involves checking whether $ARGV[0] contains
a ? or * and doing a readdir/grep type thing if it does.
---
Note: The above address is spamblocked.
The real reply-to is: wherrera (at) lynxview.com
------------------------------
Date: Sat, 16 Jan 1999 18:14:07 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: Treating Strings as FILEHANDLES
Message-Id: <36A0D8C0.8C6542C7@home.com>
[posted & mailed]
Ronald J Kimball wrote:
>
> Rick Delaney <rick.delaney@home.com> wrote:
>
> > I'm having trouble coming up with a clean way to retain the
> > newlines, though.
>
> while ( $string =~ /^(.*(?:$)\n?)/gm ) {
This has the same problem as Tad's, but only if the string *has* a
newline on the end. And it doesn't work at all under 5.005.
#!/usr/bin/perl -w
print "$]\n";
$string_with = "Line 1\nLine 2\nLine 3\n";
$string_without = "Line 1\nLine 2\nLine 3";
print "\nWith:\n";
while ( $string_with =~ /^(.*(?:$)\n?)/gm ) {
print "$1SEPARATOR\n";
}
print "\nWithout:\n";
while ( $string_without =~ /^(.*(?:$)\n?)/gm ) {
print "$1SEPARATOR\n";
}
--------
Results:
5.00402
With:
Line 1
SEPARATOR
Line 2
SEPARATOR
Line 3
SEPARATOR
SEPARATOR
Without:
Line 1
SEPARATOR
Line 2
SEPARATOR
Line 3SEPARATOR
and...
5.00502
With:
Line 2
SEPARATOR
Without:
Line 2
SEPARATOR
--
Rick Delaney
rick.delaney@shaw.wave.ca
------------------------------
Date: Sat, 16 Jan 1999 21:08:41 GMT
From: "Jack Hobbs" <jhobbs@cwix.com>
Subject: Win98 Perl?
Message-Id: <td7o2.517$Rm2.4158@news.cwix.com>
Is there a free version of Perl designed for Windows 98/DOS (doesn't need to
support GUI)?
Where?
------------------------------
Date: Sat, 16 Jan 1999 21:32:15 -0000
From: "Ian" <ijp@thornlea.force9.co.uk>
Subject: Re: Win98 Perl?
Message-Id: <LA7o2.3463$dh1.878@wards>
yeah, try www.perl.com or www.activestate.com
Jack Hobbs wrote in message ...
>Is there a free version of Perl designed for Windows 98/DOS (doesn't need
to
>support GUI)?
>
>Where?
>
>
>
------------------------------
Date: 16 Jan 1999 21:32:10 GMT
From: "Allan M. Due" <allan@due.net>
Subject: Re: Win98 Perl?
Message-Id: <77r0gq$b5s$0@206.165.165.161>
Jack Hobbs wrote in message ...
:Is there a free version of Perl designed for Windows 98/DOS (doesn't need to
:support GUI)?
:Where?
http://www.activestate.com/ActivePerl/download.htm
HTH
AmD
------------------------------
Date: Sat, 16 Jan 1999 16:31:56 -0500
From: dragons@scescape.net (Matthew Bafford)
Subject: Re: Win98 Perl?
Message-Id: <MPG.110acf541a7ff28998978b@news.scescape.net>
In article <td7o2.517$Rm2.4158@news.cwix.com>, jhobbs@cwix.com pounded in
the following:
=> Is there a free version of Perl designed for Windows 98/DOS (doesn't need to
=> support GUI)?
I don't know of any (recent) DOS [1] versions, but for Windows you can
goto:
http://www.activestate.com
=> Where?
Who? What? When? Why? How?
HTH!
--Matthew
[1] If you are referring to the command line in Windows, it isn't quite
the same thing as DOS. For one thing, it can run Windows console
programs (which is what ActivePerl really is).
------------------------------
Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
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.misc (and this Digest), send your
article to perl-users@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.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
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 V8 Issue 4670
**************************************