[9274] in Perl-Users-Digest
Perl-Users Digest, Issue: 2869 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Jun 14 06:07:20 1998
Date: Sun, 14 Jun 98 03:00:26 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Sun, 14 Jun 1998 Volume: 8 Number: 2869
Today's topics:
Re: [META] hypersensitivity (Ilya Zakharevich)
Re: [META] hypersensitivity (Ilya Zakharevich)
Re: [META] hypersensitivity (Ilya Zakharevich)
Apache and Perl <p-lanphier@psu.edu>
Array trouble - severe newbie nheagy@my-dejanews.com
Benchmark module in Perl for Win32 <jf@stuttgart.netsurf.de>
Re: conditional curiosity... <REPLY_TO_damonbrent@earthlink.net>
Re: Have we got a good free Perl manual? (le Fanttme)
Re: Have we got a good free Perl manual? <dak@mailhost.neuroinformatik.ruhr-uni-bochum.de>
Re: Have we got a good free Perl manual? <dak@mailhost.neuroinformatik.ruhr-uni-bochum.de>
Re: Have we got a good free Perl manual? <rra@stanford.edu>
Re: HELP! (Craig Berry)
Re: Missing cgi-lib.pl for Win32 Perl <bowlin@sirius.com>
Re: pack/unpack seps (Tye McQueen)
Perl and Files <jhodges@datasync.com>
Re: Perl and Files <REPLY_TO_damonbrent@earthlink.net>
Re: Perl and Files <e-larson@cu-online.com>
Re: Perl editor debugger seeker79@yahoo.com
Perl for the PC <info@!enation.org>
Re: Perl for the PC (Jeremy D. Zawodny)
Re: Preventing file conflicts topmind@technologist.com
Re: Puzzle challenge (clarified) <scribble@pobox.com>
Re: Puzzle challenge (Craig Berry)
Re: REVIEW: MacPerl: Power and Ease (Rich Morin)
run as root, setuid to another id <brian@ilinx.com>
silly tired question... (Kevin Johnson)
Re: silly tired question... (Kevin Johnson)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 14 Jun 1998 08:05:03 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: [META] hypersensitivity
Message-Id: <6m007f$cmt$1@mathserv.mps.ohio-state.edu>
[A complimentary Cc of this posting was sent to Tom Christiansen
<tchrist@mox.perl.com>],
who wrote in article <6lp867$s25$1@csnews.cs.colorado.edu>:
> The problem, in a nutshell, is that whenever we point out a simple and
> obvious--sometimes even elegant--solution, one which inevitably
^^^^^^^^^^
Wrong. See pfind.
> involves gluing together other tools (which, I must point out, was
> what Perl *designed* for)
You are confused. This is what csh was designed for. 1/2 ;-)
Ilya
------------------------------
Date: 14 Jun 1998 08:08:45 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: [META] hypersensitivity
Message-Id: <6m00ed$d09$1@mathserv.mps.ohio-state.edu>
[A complimentary Cc of this posting was sent to Mike Stok
<mike@stok.co.uk>],
who wrote in article <6lpjnh$7of@news-central.tiac.net>:
> >There is a man, whose initials are rms -- a brilliant, pioneering, and
> >widely respected computer scientist; he would disagree with you on this
> >point. He attempted to learn Perl from the provided documentation, and
> >gave up in utter frustration. So how good can the be really?
>
> He may have been learning from the perl 4.xxx and before docs. Tom
> Christiansen has put considerable effort into the new doc set which comes
> with perl 5.xxx and both expanded and organised it better than before.
Perl 4 manpage was *excellent*. Perl5 docs are excellent *if* read
with proper tools.
Ilya
------------------------------
Date: 14 Jun 1998 08:13:26 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: [META] hypersensitivity
Message-Id: <6m00n6$dh9$1@mathserv.mps.ohio-state.edu>
[A complimentary Cc of this posting was sent to John Porter
<jdporter@min.net>],
who wrote in article <35802C15.3D11@min.net>:
> There is a man, whose initials are rms -- a brilliant, pioneering, and
> widely respected computer scientist;
I wonder how many of those "widely respecting" him read his code? It
is pretty hard to preserve this respect after plunging in.
> he would disagree with you on this point. He attempted to learn
> Perl from the provided documentation, and gave up in utter
> frustration. So how good can the be really?
Much better than docs for *anything* RMS was ever associated with.
Ilya
P.S. Do not try to extend my viewpoint beyond code-style and
documentation-quality angles, it is not *that* straightforward.
------------------------------
Date: Sat, 13 Jun 1998 23:12:49 -0400
From: "Patrick Lanphier" <p-lanphier@psu.edu>
Subject: Apache and Perl
Message-Id: <6lvf9p$1e5k@r02n01.cac.psu.edu>
Keywords: perl apache modperl
What are the settings for the srm file for Apache so the when the file
extension pl or plx is used it will automatically fire the Perl interpreter?
Better yet has anybody compiled the modperl for NT for version 1.3b7 of
Apache?
Patrick Lanphier
Applied Research Laboratory
The Pennsylvania State University
------------------------------
Date: Sun, 14 Jun 1998 07:33:18 GMT
From: nheagy@my-dejanews.com
Subject: Array trouble - severe newbie
Message-Id: <6lvubu$1k0$1@nnrp1.dejanews.com>
Thank you for taking the time to read this. I have light experience in PASCAL
and am now trying to learn PERL for CGI scripting. I have managed to write a
flat-file database program that searches a file and prints matches to pre-set
search strings in only one field (of about a dozen). I would now like to sort
the list by one field (city) and then have an on-the-fly menu of cities
listed at the top that link to anchors for each city. I think I can do most
of it, but I have no idea how to put the results into an array so that I can
keep track of the results and print the cities list BEFORE the results. I am
using arrays to load SHTML header/foot files, and would expect to do somthing
similar, however I have no idea where to start. The PERL documentation is too
hard for me to understand.
Basically, how do I print to an array?
Thanks,
Nathan R Heagy.
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: Sun, 14 Jun 1998 01:46:41 +0200
From: Jochen Froehlich <jf@stuttgart.netsurf.de>
Subject: Benchmark module in Perl for Win32
Message-Id: <35830F61.CB096B@stuttgart.netsurf.de>
Hi everyone,
I tried to 'use Benchmark' with Perl for Win32 Build 316 on NT and
got the following message:
Benchmark: timing 100000 iterations of a, b...
times not implemented at D:\usr\lib/Benchmark.pm line 274.
Line 274 in D:\usr\lib/Benchmark.pm is:
sub new { my(@t)=(time, times); print "new=@t\n" if $debug; bless \@t; }
The question is:
How can 'Benchmark' be used with Perl for Win32 if 'times'
is not implemented there (as the error message indicates)?
Hope you can help. Thanks in advance!
Jochen Froehlich
jf@stuttgart.netsurf.de
A supercomputer is a machine
that performs an endless loop in two seconds.
------------------------------
Date: Sun, 14 Jun 1998 02:41:16 -0400
From: "Brent Verner" <REPLY_TO_damonbrent@earthlink.net>
Subject: Re: conditional curiosity...
Message-Id: <6lvrai$gj9$1@chile.it.earthlink.net>
so, all is equal as far as the machine is concerned? ... or does the
machine like one more than the other?
thanks,
brent
Tom Phoenix wrote in message ...
>On Sat, 13 Jun 1998, Brent Verner wrote:
>
>> is there any benefit (aside from less lines of code) to using :
>>
>> $a = $b if $b;
>>
>> rather than :
>>
>> if ($b)
>> {
>> $a = $b;
>> }
>
>They should be interchangeable for all practical purposes. Hope this
>helps!
>
>--
>Tom Phoenix Perl Training and Hacking Esperanto
>Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
>
------------------------------
Date: Sun, 14 Jun 1998 03:40:34 GMT
From: fantome/@/usa/./net (le Fanttme)
Subject: Re: Have we got a good free Perl manual?
Message-Id: <A6DE5ABA24590B88.9BCFE25F35DAEFA4.3363289A3FE3333B@library-proxy.airnews.net>
On 12 Jun 1998 23:36:33 +0200, David Kastrup
<dak@mailhost.neuroinformatik.ruhr-uni-bochum.de> wrote:
>lehman@visi.com (Todd Lehman) writes:
>
>> [dak:]
>> >
>> > This is nonsense. It is a loss to the community period. If they were
>> > under some cosmic obligation, the community would not encounter any
>> > loss because it could sue them for providing the stuff. As they are
>> > not under an obligation, it is a loss to the community for good.
>>
>> Aren't you confusing loss with non-gain? Was the documentation sold
>> to O'Reilly once freely available? If so, then you could consider it a
>> loss. If not, then to call it a loss is to presume that it would have
>> and should have been contributed to the community all along, and that is
>> up to the authors and -no one- else.
>
>No, that it *could* have been contributed to the community. Once you
>have signed over your marketing rights exclusively to some publisher,
>this option is gone.
Not that a smart author ever does this. Said author usually negotiates
specific publishing rights -- first North American printing, for
example.
Unless it's a work for hire.
I suspect that the authors of the Perl books kept electronic
distribution rights, but sold only the publication rights.
-f
--
austin ziegler * fantome*@*vnet*.*net * http://fantome.vnet.net/
---------------* aziegler*@*vcela*.*com * -------------------------
Remove the stars to email me * And if I don't see you,
my words my opinions my ideas * good afternoon, good
* evening, and goodnight
------------------------------
Date: 14 Jun 1998 10:39:56 +0200
From: David Kastrup <dak@mailhost.neuroinformatik.ruhr-uni-bochum.de>
Subject: Re: Have we got a good free Perl manual?
Message-Id: <m2u35ojs0z.fsf@mailhost.neuroinformatik.ruhr-uni-bochum.de>
lehman@visi.com (Todd Lehman) writes:
> Matt Pharr <mmp@graphics.stanford.edu> writes:
> > lehman@visi.com (Todd Lehman) writes:
> > > I admire that. What I don't admire is pissing on ORA and on Perl book
> > > authors because they don't share 100% of his vision.
> >
> > I should know better than to get involved in this, but where _exactly_ did
> > RMS 'piss on other people'?
>
> 'Pissing on' was a poor word choice. He didn't. What he was doing was
> looking down on ORA and the Perl book authors as if they did something
> wrong by not contributing the documentation freely and as if there is
> anyone alive who has been hurt by that.
Please come up with an actual quote to underline your wild
accusations. RMS does not talk about people doing something wrong or
looking down or whatever else you wildly assume. He just says that
non-free books don't fit his demands and are inappropriate as
documentation for free software. As it can make the difference
between free software being useful for a Person in Third-World States,
China, former Soviet union etc. I think this not as awfully arrogant,
evil, derogatory and whatever else people want to call it.
--
David Kastrup Phone: +49-234-700-5570
Email: dak@neuroinformatik.ruhr-uni-bochum.de Fax: +49-234-709-4209
Institut f|r Neuroinformatik, Universitdtsstr. 150, 44780 Bochum, Germany
------------------------------
Date: 14 Jun 1998 10:43:42 +0200
From: David Kastrup <dak@mailhost.neuroinformatik.ruhr-uni-bochum.de>
Subject: Re: Have we got a good free Perl manual?
Message-Id: <m2sol8jrup.fsf@mailhost.neuroinformatik.ruhr-uni-bochum.de>
Russ Allbery <rra@stanford.edu> writes:
> In comp.lang.perl.misc, Paul David Fardy <pdf@morgan.ucs.mun.ca> writes:
>
> > Odd... Why don't they need "a good free manual for TeX"?
>
> Because TeX's documentation is distributed under something functionally
> equivalent to the Artistic License
Please reread the copyright notice on the TeX book, the canonical
documentation of TeX.
> , and the documentation that comes with
> TeX or is available via other places such as CTAN is honestly nearly
> sufficient.
Disagree. There is almost nothing in the line of freely available TeX
documentation. The TeX book is pretty much canonical, here. You are
confusing this with LaTeX, for which there is indeed quite a lot of
useful information available freely.
--
David Kastrup Phone: +49-234-700-5570
Email: dak@neuroinformatik.ruhr-uni-bochum.de Fax: +49-234-709-4209
Institut f|r Neuroinformatik, Universitdtsstr. 150, 44780 Bochum, Germany
------------------------------
Date: 14 Jun 1998 02:08:17 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: Have we got a good free Perl manual?
Message-Id: <m3wwak73lq.fsf@windlord.Stanford.EDU>
David Kastrup <dak@mailhost.neuroinformatik.ruhr-uni-bochum.de> writes:
> There is almost nothing in the line of freely available TeX
> documentation. The TeX book is pretty much canonical, here. You are
> confusing this with LaTeX, for which there is indeed quite a lot of
> useful information available freely.
I apologize; you're correct.
--
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print
------------------------------
Date: 14 Jun 1998 08:18:51 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: HELP!
Message-Id: <6m011b$359$1@marina.cinenet.net>
Eric Bohlman (ebohlman@netcom.com) wrote:
: Refresh my memory: which release eliminated the need for the sharpened
: walrus tusks?
5.000; then you needed them again for 5.001, but not for 5.002 and above.
Me, I just wish we could ditch the black-hen-blood requirement. Ever try
getting that stuff out of a light-colored carpet?
---------------------------------------------------------------------
| Craig Berry - cberry@cinenet.net
--*-- Home Page: http://www.cinenet.net/users/cberry/home.html
| Member of The HTML Writers Guild: http://www.hwg.org/
"Every man and every woman is a star."
------------------------------
Date: Sat, 13 Jun 1998 22:43:57 -0700
From: Jim Bowlin <bowlin@sirius.com>
To: David Wasserstrum <zeos@gti.com>
Subject: Re: Missing cgi-lib.pl for Win32 Perl
Message-Id: <3583631D.7FE5F709@sirius.com>
David Wasserstrum wrote:
>
> Is it just me or did perl forget to include that nice standard
> cgi-lib.pl file with there windows version of Perl???
David, CGI.pm rules! The cgi-lib.pl file is neither nice nor standard.
If you want to port your code from cgi-lib to CGI.pm, check
out the section of the CGI.pm docs called "Migrating from cgi-lib.pl".
HTH -- Jim Bowlin
------------------------------
Date: 13 Jun 1998 23:01:00 -0500
From: tye@fohnix.metronet.com (Tye McQueen)
Subject: Re: pack/unpack seps
Message-Id: <6lvhts$h2r@fohnix.metronet.com>
Ruben I Safir <rs83@is7.nyu.edu> writes:
)
) I was just explaining to you my problem with the documentation. If you want
) to hide your head in the sand and say that the docs explain the function
) clearly, go right ahead.
Well, _I_ think that pack() and unpack() are pretty poorly
explained in perlfunc.pod. Most of the template characters are
glossed over too quickly. The section on unpack() doesn't even
list the template characters which forces you to go back to the
pack() section where some of the explanations are not correct
when using unpack(), for example:
What does "x" do in unpack()?
"a" and "A" don't "pad" in unpack(); exactly how do they trim?
So pack() is explained moderately well but too tersely while the
documentation for unpack() is extremely short. I've meant to
offer improvements but haven't managed to carve out the time to
start writing them.
The concepts dealt with in pack() and unpack() are rather hard to
explain as it is. Some people understand them easilly while many
aren't completely comfortable with the details of how different
types of data are stored by computers. When I read the descriptions
of pack() and unpack() I'm struck by how strongly they peg my
"assumed knowledge" meter.
To explain pack() and unpack(), I think you need to start out
defining some terms. "bit" is used in contradictory ways in those
sections. All the talk of numbers is really confusing unless you
understand that low-level formats are the important part here and
understand how bits form bytes which form any number of other data
types in a computer.
You also have to understand that pack() and unpack() don't always
transform data, but almost always copy it and almost always change
how Perl interprets it. unpack() takes something that Perl is
interpretting as a string and moves [part of] it to a place where
Perl will interpret it differently, usually as a number [and
transforms it into one of a few number formats that Perl prefers].
Perl normally automatically converts between data formats so
thinking about pack() and unpack() requires a mindset nearly
oposite to that used to think about Perl.
Perhaps a fairly short perlpack.pod is in order?
--
Tye McQueen Nothing is obvious unless you are overlooking something
http://www.metronet.com/~tye/ (scripts, links, nothing fancy)
------------------------------
Date: Sat, 13 Jun 1998 21:52:29 -0500
From: "Jay Hodges" <jhodges@datasync.com>
Subject: Perl and Files
Message-Id: <6lvdsn$mml$1@osh2.datasync.com>
I know this question will be answered easily, but here it goes. When
writing a Perl cgi, how do I open a non-existent file for output?
------------------------------
Date: Sat, 13 Jun 1998 23:28:24 -0400
From: "Brent Verner" <REPLY_TO_damonbrent@earthlink.net>
Subject: Re: Perl and Files
Message-Id: <6lvg0f$mio$1@chile.it.earthlink.net>
Jay Hodges wrote in message <6lvdsn$mml$1@osh2.datasync.com>...
>I know this question will be answered easily, but here it goes. When
>writing a Perl cgi, how do I open a non-existent file for output?
>
>
huh???
output???
if you open a file to write [ open (FILE, ">$filename"); ] the file will be
created automatically.
i'm not sure what would happen if you opened a file to read [ open (FILE,
"<$filename"); ] that did not exist. { what could you possibly need to read
from a nonexistent file? }
brent
(remove 'REPLY_TO_' from address to email)
------------------------------
Date: Sat, 13 Jun 1998 23:26:02 -0500
From: e-larson <e-larson@cu-online.com>
Subject: Re: Perl and Files
Message-Id: <358350DA.ED1BB4EC@cu-online.com>
> >I know this question will be answered easily, but here it goes. When
> >writing a Perl cgi, how do I open a non-existent file for output?
>
> if you open a file to write [ open (FILE, ">$filename"); ] the file will be
> created automatically.
=============
My guess is he's trying to open a file using a perl program that's
been launched via a httpd post/get. In this case, perl won't be able
to create the new file unless permissions, where the new file is to be
created, allows the file to be created.
Eric Larson
e-larson@cu-online.com
Remove the name-dash for e-mail
------------------------------
Date: Sun, 14 Jun 1998 05:35:19 GMT
From: seeker79@yahoo.com
Subject: Re: Perl editor debugger
Message-Id: <6lvnen$nfg$1@nnrp1.dejanews.com>
> What would you say is the best Perl editor/debugger available is
> commercially or free for Windows NT?
>
Check out Perl Builder at http://www.solutionsoft.com/perl.htm. This is the
only product I know of which offers a full IDE for Perl.
Dave Seeker
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: Sun, 14 Jun 1998 04:05:26 GMT
From: e_nation <info@!enation.org>
Subject: Perl for the PC
Message-Id: <a_Hg1.257$ZL5.308585@news2.randori.com>
I am interested in gettin a perl compiler for the PC so I can compile my
own scripts and test/debug them before they get uploaded.
Is there a PC compiler for perl?
Thanks
------------------------------
Date: 14 Jun 1998 00:39:07 -0400
From: jzawodn@wcnet.org (Jeremy D. Zawodny)
Subject: Re: Perl for the PC
Message-Id: <m3u35ok36c.fsf@peach.z.org>
e_nation <info@!enation.org> writes:
> I am interested in gettin a perl compiler for the PC so I can compile my
> own scripts and test/debug them before they get uploaded.
Great!
> Is there a PC compiler for perl?
Yes, and the information you need is all in the FAQ. Please see the
frequent postings in comp.lang.perl.announce by Tom Phoenix.
Jeremy
--
Jeremy D. Zawodny Web Geek, Perl Hacker, etc.
http://www.wcnet.org/~jzawodn/ jzawodn@wcnet.org
LOAD "LINUX",8,1
------------------------------
Date: Sun, 14 Jun 1998 06:57:56 GMT
From: topmind@technologist.com
Subject: Re: Preventing file conflicts
Message-Id: <6lvs9k$u8b$1@nnrp1.dejanews.com>
> ...so I [sarcasm] will just ask for free consulting
> help instead of looking things
> up things in the docs on my own system."
>
How about you set a threashold. How long should one spend lurking around in
the manuals or included doc before they turn to a newsgroup? Please give an
answer in minutes or hours. This should make it clear where "selfishness"
ends.
-tmind-
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: 14 Jun 1998 01:54:54 -0500
From: Tushar Samant <scribble@pobox.com>
Subject: Re: Puzzle challenge (clarified)
Message-Id: <6lvs3u$iup@tekka.wwa.com>
To add the obvious -- the "correct" algorithm may be arrived at
by running all the suggested algorithms (and a few others) in a
tournament...
------------------------------
Date: 14 Jun 1998 08:25:46 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Puzzle challenge
Message-Id: <6m01ea$359$2@marina.cinenet.net>
Igor Krivokon (igor.k@usa.net) wrote:
[snip]
: Let's take into consideration the following fact:
: if the order is wrong, we can not trust the messenger anymore.
:
: The algorithm now is:
: Find the most common first element. Add it to resulting list.
: Remove all occurences from the list; if the element found not in the
: first
: position, remove the whole row.
: Remove empty rows.
: Repeat until there's nothing left.
The problem is, what if a messenger who gets the order wrong is also the
only one who remembers one or more of the names? Your algorithm would
throw away these names entirely. The simple most-common-first algorithm
posted earlier would tend to sort them to the end of the list, but at
least they'd be there.
---------------------------------------------------------------------
| Craig Berry - cberry@cinenet.net
--*-- Home Page: http://www.cinenet.net/users/cberry/home.html
| Member of The HTML Writers Guild: http://www.hwg.org/
"Every man and every woman is a star."
------------------------------
Date: Sat, 13 Jun 1998 22:49:24 -0700
From: rdm@cfcl.com (Rich Morin)
Subject: Re: REVIEW: MacPerl: Power and Ease
Message-Id: <rdm-1306982249240001@140.174.42.30>
In article <6lur3b$knc$5@csnews.cs.colorado.edu>, tchrist@mox.perl.com
(Tom Christiansen) wrote:
> MacPerl: Power and Easeby by Vicki Brown and Chris Nandor with foreword
> by Matthias Neeracher and published by Prime Time Freeware, is hereby
> awarded a rating of 4 Camels on the Camel Critiques page found at
> http://www.perl.com/perl/critiques/
>
> Here's the capsule review included there:
>
> If you're on a Mac and want to learn Perl, you want this book. It's
> specifically geared for you, written from an Apple perspective
> throughout. The prose is clean, and the typesetting refreshingly
> direct and easy to read, free of annoying artifacts too often found
> in books mentioned lower down on this list.
>
> I note that it is relatively expensive ($40), but worth it.
> This is a tutorial book.
>
> --tom
Thanks for the Camels, Tom! Here is some supplementary information,
along with the citation:
MacPerl is served by the MacPerl Pages (http://www.ptf.com/macperl)
and a very active email list. "MacPerl: Power and Ease" is Prime
Time Freeware's new introduction and reference to MacPerl:
MacPerl: Power and Ease
Vicki Brown and Chris Nandor
Prime Time Freeware, 1998
ISBN 1-881957-32-2
400 pp., HFS CD-ROM; $40 MSRP
"MacPerl: Power and Ease" is available for online browsing; see:
http://www.ptf.com/macperl/ptf_book/HTML/
-r
--
Canta Forda Computer Laboratory | Prime Time Freeware - quality
UNIX consulting, training, & writing | freeware at affordable prices
+1 415-873-7841 | +1 408-433-9662 -0727 (Fax)
Rich Morin, rdm@cfcl.com | www.ptf.com, info@ptf.com
------------------------------
Date: Sat, 13 Jun 1998 22:02:28 -0700
From: "Brian J. Murrell" <brian@ilinx.com>
Subject: run as root, setuid to another id
Message-Id: <35835964.32E4BAC3@ilinx.com>
Hello,
Running perl 5.004 (or nearso) I want to have a script which is running
as root, setuid itself to another id. That is, the script will start
out running under root's uid, but at some point in the script, it needs
to become another user, mainly so that files it creates, etc. are owned
by this new user. Also to reduce the risk of somebody doing something
evil as root.
In `C', I would simply execute the following:
main(int argc, char **argv) {
[ whatever needs to be done as root...]
/* newid is the numeric value of the id to change to */
setuid(newid);
[ do rest of whatever...]
}
How can I do this in perl?
Much thanx,
b.
--
Brian J. Murrell
brian@interlinx.bc.ca
InterLinx Support Services, Inc.
North Vancouver, B.C. 604
983 UNIX
Platform and Brand Independent UNIX Support - R3.2 - R4 - BSD
------------------------------
Date: 14 Jun 1998 07:25:01 GMT
From: kevin@mercury.ig.utexas.edu (Kevin Johnson)
Subject: silly tired question...
Message-Id: <6lvtsd$lh1$1@geraldo.cc.utexas.edu>
Morning. I have what I hope is a simple problem. I've got a constuct
that looks like this...
(/rec/) && do {
split;
@arr = @_;
};
(/First trace/) && do {
split;
if ($arr[2] == "nsamp") { $nsamp=@_[4]; print $nsamp,"\n",$arr[2],"\n";}
};
inside a while(<>) and some other stuff, basically rolling through a lot
file and gathering info. Anyway, it appears that the if statement always
evaluates to true and hence the block always gets executed. I can't see
any reason why it should though. I would appreciate if anyone can help me
out. Thanks in advance. Please also reply via email to
K_Johnson@mail.utexas.edu
Kevin
------------------------------
Date: 14 Jun 1998 07:32:25 GMT
From: kevin@mercury.ig.utexas.edu (Kevin Johnson)
Subject: Re: silly tired question...
Message-Id: <6lvua9$lh1$2@geraldo.cc.utexas.edu>
Kevin Johnson (kevin@mercury.ig.utexas.edu) wrote:
I'll answer my own question...
: if ($arr[2] == "nsamp") { $nsamp=@_[4]; print $nsamp,"\n",$arr[2],"\n";}
^^
eq for string equality... *bang bang bang*
*sigh* Sorry for the mispost.
Kevin
------------------------------
Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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.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 2869
**************************************