[9223] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 2818 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jun 8 23:07:27 1998

Date: Mon, 8 Jun 98 20:00:24 -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           Mon, 8 Jun 1998     Volume: 8 Number: 2818

Today's topics:
    Re: [NT]: Getting Perl CGI to work <pmcgilla@cpinterent.com>
        Capturing STDERR alex@inova.net
    Re: Capturing STDERR <tchrist@mox.perl.com>
    Re: Capturing STDERR <rootbeer@teleport.com>
    Re: Day of Week Display for User-defined date (Jonathan Stowe)
    Re: Day of Week Display for User-defined date (I R A Aggie)
    Re: Exercise in Llama Book <nospamtimbenjamin@mcmail.com>
        FA: $10.00 Teach Yourself Perl in 21 Days (Elric of Imrryr)
        filenames between UNIX and win95 <giordano@pobox.com>
        pass the gravy and the hashref, please <cwinters@intes.net>
    Re: Preventing file conflicts <jgoldberg@dial-put_dot_here-pipex.com>
    Re: Preventing file conflicts <tchrist@mox.perl.com>
    Re: Preventing file conflicts <zenin@bawdycaste.org>
    Re: RECOMMEND A PERL BOOK/RESOURCES ?? (Todd C. Ames)
        rexx to perl conversion <pjhugh01@gwise.louisville.edu>
    Re: rexx to perl conversion <tchrist@mox.perl.com>
    Re: Script Auto-restart - using -M file test - Cannonic <vallon@bear.com>
    Re: Setting @INC as needed <zenin@bawdycaste.org>
    Re: setting precision??? (Martien Verbruggen)
    Re: use strict vs. iterative filehandles? (Mike Stok)
    Re: use strict vs. iterative filehandles? (Thomas Wernitz)
        Web Hosting with CGI <jj239733@aol.com>
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Mon, 8 Jun 1998 21:36:46 -0500
From: "Patrick L. McGillan" <pmcgilla@cpinterent.com>
Subject: Re: [NT]: Getting Perl CGI to work
Message-Id: <6li7ha$t6j16@saganaga.computerpro.com>

See this article
http://support/microsoft.com/support/kb/articles/q150/6/29.asp It worked for
me~

Patrick

David Sanders wrote in message <8bEd1.130$Aj.2019876@iagnews.iagnet.net>...
>I recently installed Perl for Win32, and can run scripts from the
>command prompt.  However, when I first started trying to run sample
>("Hello, world!") scripts on my IIS 4.0, it would give me, "%1 is not
>a valid WinNT application".  Well, I seem to have fixed that, but am
>still having problems.  When I try to execute the script now, the
>computer just runs and runs and runs, until _I_ stop it.
>
>Here is my sample script:
>
>print "HTTP/1.0 200 OK\n"; print "Content-Type: text/html\n\n";
>
>print "<HTML>\n"; print "<HEAD>\n"; print "<TITLE>Hello
>World</TITLE>\n"; print "</HEAD>\n"; print "<BODY>\n"; print
>"<H4>Hello World</H4>\n"; print "<P>\n"; print "Your IP Address is
>$ENV{REMOTE_ADDR}.\n"; print "<P>"; print "<H5>Have a nice
>day</H5>\n"; print "</BODY>\n"; print "</HTML>\n";
>
>What is wrong???
>
>Also, how do I set up my paths properly?
>#! does not seem to work on NT, and I can't find out how to get it to
>run.
>
>Thanks in advance for your help,
>Dave
>
>
>




------------------------------

Date: 8 Jun 1998 16:30:25 -0700
From: alex@inova.net
Subject: Capturing STDERR
Message-Id: <6lhs6h$i4s@drn.newsguy.com>

Hi,

I am executing programs on my system via a script. I need to capture the output
from these programs, but it seems to only work when the output is to STDOUT.

ex.
$grp=`groupadd mygroup`;

if the group mygroup already exists a warning is sent to STDERR and is not
caputured in my var. $grp.

How would I be able to capture STDERR as well?

Any help would be greatly appreciated.

Alex Panagides
Ceara, Brazil

------------------
Spam free Usenet news http://www.newsguy.com


------------------------------

Date: 9 Jun 1998 00:33:10 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Capturing STDERR
Message-Id: <6lhvs6$ipo$1@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, alex@inova.net writes:
:How would I be able to capture STDERR as well?

You'd check the FAQ, or my recent postings about this.

--tom
-- 
    X-Windows: It could be worse, but it'll take time.
	--Jamie Zawinski


------------------------------

Date: Tue, 09 Jun 1998 00:43:39 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Capturing STDERR
Message-Id: <Pine.GSO.3.96.980608174258.29617c-100000@user2.teleport.com>

On 8 Jun 1998 alex@inova.net wrote:

> How would I be able to capture STDERR as well?

The method in section 8 of the FAQ should work for you. Hope this helps!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



------------------------------

Date: Tue, 09 Jun 1998 00:16:20 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: Day of Week Display for User-defined date
Message-Id: <357c7126.23835527@news.btinternet.com>

On Mon, 08 Jun 1998 18:23:18 -0400, KC Lucchese wrote :

<snip>
>
>I withdraw my plea for help....  you people can go back to your important
>discussions of whatever it is that people with no manners and no social
>skills prefer to discuss.

no manners and no social skills >

On Mon, 08 Jun 1998 14:41:20 -0400, KC Lucchese wrote :

>What a witch.  Your trailer park cancel bingo again, honey?
>
(Sorry for repeating that Abigail but the point has to be made)

Who is exhibiting here a lack of manners and social skills precisely ?

Now get back in your pram and read your FAQ-with-mother and reflect
upon why it is that you have drawn this response here.

/J\
Jonathan Stowe
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>



------------------------------

Date: Mon, 08 Jun 1998 21:05:56 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Day of Week Display for User-defined date
Message-Id: <fl_aggie-0806982105560001@aggie.coaps.fsu.edu>

In article <357C6454.ACB9A54C@mindspring.com>, KC Lucchese
<kcl@mindspring.com> wrote:

+ Geez, what is it with you people....

We don't like being abused by a rude luser like yourself? this comes to
you as a shock?

+ I was hoping for a helping hand and I get smug, nasty "I'm smarter 
+ than you are" rhetoric.

Abigail is smarter than you are simply because she took the time to figure
out _how_ to find the information necessary to answer a given question.

+ In the time it takes you to scold me you could have pointed me to an
+ answer.

Which has already been done, if I remember the postings in this thread.
I was simply trying to point out to you that you catch more flies with
honey than vinegar. But hey, if you want to go around and insult people
who might be in a position to help you, that's your business.

And actually, it takes less time for me to scold than to find the solution,
hack some code, test the code -- you would like it to work, yes? -- and
then post it to Usenet. All that, for free. Maybe I should send you a rate
card instead?

+ For the record, I DID read the FAQ.... I searched through page after page
+ of complicated programming information written for the advanced user and
+ was unable to come up with an answer that worked. All I'm trying to do is
+ maintain this piece of crap system that I inherited until I can rewrite
+ it in something I'm more experienced in.

+ Give a guy a break.

Ok, here's a break. Instead of "someone hold my hand, I'm scared" post,
why not try:

  Ok, the FAQ said to do X. I did X, but instead of getting Y, I get Z.
  I don't understand what's going on.

Follow that with a small code snippet. Those sorts of questions usually
get answered.

+ I withdraw my plea for help....  you people can go back to your important
+ discussions of whatever it is that people with no manners and no social
+ skills prefer to discuss.

Which one of us called you a witch or similar derogatory term?

James

-- 
Consulting Minister for Consultants, DNRC
The Bill of Rights is paid in Responsibilities - Jean McGuire
To cure your perl CGI problems, please look at:
<url:http://www.perl.com/CPAN-local/doc/FAQs/cgi/idiots-guide.html>


------------------------------

Date: Tue, 09 Jun 1998 01:43:59 +0100
From: Tim Benjamin <nospamtimbenjamin@mcmail.com>
Subject: Re: Exercise in Llama Book
Message-Id: <357C854F.DEAB6D64@mcmail.com>

I don't know if this is a bug or if I'm doing something incredibly dumb, but
here goes:

-w;
print "Type some strings, finish with CTRL-Z:\n";
@array=<STDIN>;
print @array;

If you type in
a    b    c    d    e    f
(each on new lines)
it prints out:
b    c    d    e    f
(each on new lines)
However, if you change line 3 to
chomp(@array=<STDIN>);
it works, i.e. it gives:
abcdef

Can anyone cast any light on this?
I am using the most recent Win32 version of Perl.

Thanks,
Tim.



------------------------------

Date: Mon, 8 Jun 1998 18:55:38 -0700
From: Elric.of.ImrryrNOSPAM@usa.net (Elric of Imrryr)
Subject: FA: $10.00 Teach Yourself Perl in 21 Days
Message-Id: <MPG.fe635f5225cf56a989754@news.pacbell.net>

For sale via auction ending at:06/12/98 10:38:28 PST
To bid go to:
http://cgi.ebay.com/aw-cgi/eBayISAPI.dll?ViewItem&item=16659296



Teach Yourself Perl in 21 Days  By David Till

    Sams Publishing, Soft Cover, 840 Pages, 

    7 Discover how to write and successfully run a Perl program 

    7 Find out the difference between interpretive, and compiled programming 

    7 Master the basics of Perl programming and build on them 

    7 Gain the ability to manipulate text generate reports and perform system 
tasks using the Perl programming

Teach Yourself Perl in 21 Days is the ideal book for beginning and 
intermediatelevel users who want to gain a solid understanding of this 
programming language Using stepbystep tutorials, you can Teach Yourself Perl 
in 21 Days! Through various teaching elements, you'll learn everything you need 
to know about this popular programming language. You'll discover how to 
manipulate text, generate reports, and perform system tasks. Through practical, 
handson instructions, logically organized lessons, and helpful
Q&A sections. You'll master Perl functions and concepts and be developing 
robust programs in no time. Plus, Do/Dont boxes show you how to avoid 
potential programming pitfalls.

Illustrations explain constructs such as associative arrays, and tables serve 
as handy references. 

David Till is a technical writer working in Canada. He holds a masters degree 
in computer science from the University of Waterloo, with programming languages 
being his major field of study. Till has worked also in compiler development 
and on version control software. 
                                               Contents at a Glance

Overview 

Introduction 

Getting Started 

Basic Operators and Control Flow 

Understanding Scalar Values 

More Operators 

Lists and Array Variables 

Reading from and Writing to Files 

Pattern Matching 

More Control Structures 

Using Subroutines 

Associative Arrays 

Formatting Your Output 

Working with the File System 

Process-Manipulation and Mathematical Functions 

Scalar Conversion Functions 

List-Manipulation Functions 

System Functions 

Command-Line Options 

System Variables 

Miscellaneous Features of Perl 

The Perl Debugger 

 See Also

Practical Repair and Maintenance of CommEquip
http://cgi.ebay.com/aw-cgi/eBayISAPI.dll?ViewItem&item=16540358

Dracula by Bram Stoker
http://cgi.ebay.com/aw-cgi/eBayISAPI.dll?ViewItem&item=16604542

Teach Yourself Perl in 21 Days
http://cgi.ebay.com/aw-cgi/eBayISAPI.dll?ViewItem&item=16659296

Crystallographic Computing 3
http://cgi.ebay.com/aw-cgi/eBayISAPI.dll?ViewItem&item=16660734

Troubleshooting TCP/IP By Mark A Miller, P.E
http://cgi.ebay.com/aw-cgi/eBayISAPI.dll?ViewItem&item=16661849

Practical DSP Modeling in C w/ DISK
http://cgi.ebay.com/aw-cgi/eBayISAPI.dll?ViewItem&item=16662123

Creating Web Applets With Java w/ CD-ROM DISK
http://cgi.ebay.com/aw-cgi/eBayISAPI.dll?ViewItem&item=16662318

Lan Survival A Guerilla Guide to Netware
http://cgi.ebay.com/aw-cgi/eBayISAPI.dll?ViewItem&item=16662504

Al Agents in Virtual Reality Worlds in C++
http://cgi.ebay.com/aw-cgi/eBayISAPI.dll?ViewItem&item=16666179

NETWARE 4.1 Survial Guide
http://cgi.ebay.com/aw-cgi/eBayISAPI.dll?ViewItem&item=16666871

Netware 4 Network Design and Implementation
http://cgi.ebay.com/aw-cgi/eBayISAPI.dll?ViewItem&item=16667930

OS/2 Warp Unleashed Deluxe Edition w/CD
http://cgi.ebay.com/aw-cgi/eBayISAPI.dll?ViewItem&item=16684305

OS/2 WARP PROFESSIONAL REFERENCE
http://cgi.ebay.com/aw-cgi/eBayISAPI.dll?ViewItem&item=16684305

OS/2 WARP ADMINSTRATOR'S Survival Guide
http://cgi.ebay.com/aw-cgi/eBayISAPI.dll?ViewItem&item=16692268

Graphics Programming for Win95 C++
http://cgi.ebay.com/aw-cgi/eBayISAPI.dll?ViewItem&item=16700393

Principles of Microeconomics
http://cgi.ebay.com/aw-cgi/eBayISAPI.dll?ViewItem&item=16728716


------------------------------

Date: Mon, 08 Jun 1998 20:20:55 -0500
From: Tony Giordano <giordano@pobox.com>
Subject: filenames between UNIX and win95
Message-Id: <357C8DF7.DA72BA30@pobox.com>

I am writing a script that gets a filename from an HTML form and then
copies that file from the client computer (Windows) to the server
(Solaris).  By problem is that the backslashes used by Windows sometimes
creates special characters.

This filename works
c:\directory\file.txt

This doesn't work
c:\temp\file.txt
because the \t is sent as a tab.
c:    emp\file.txt

This kind of thing happens with certain other characters also.

Can anyone help me keep the characters from 'escaping ' and just use
them as they are.  (Like the difference between double and single quotes
in UNIX shells).

Thanks



------------------------------

Date: Mon, 08 Jun 1998 21:29:09 -0400
From: Chris Winters <cwinters@intes.net>
Subject: pass the gravy and the hashref, please
Message-Id: <357C8FE5.94CC1AF4@intes.net>

Hello,

A problem that's puzzling me. I will try to explain it as clearly as I
can.

1) The parent object contains an arrayref of zero or more child
objects

2) The parent object contains a hashref of values, with keys as
fieldnames from the child objects

3) When the child objects are instantiated, they are passed the
parent's hashref of 
   values to make themselves useful. 

   $parent->{elements}->[ $element_num ] = Element->new( values =>
$self->{values} );

4) When I do a Data::Dumper of the resulting object, I see something
like this:

$VAR1 = bless(  {
	          values => {
				foo => 'dizzy',
				bar => 'dean',
				baz => 'smiley'
			    },
		  elements => [  
				bless( {
					values => $VAR1->{values},
					other_item => 'bleh',
					yet_another => ['arg', 'ack']
					}, 'Child' ),
				bless ( {
					values => $VAR1->{values},
					other_item => 'blargh',
					yet_another => ['ugh','oof']
					}, 'Child' ),
				], 
		}, 'Parent' );

(apologies if it's misformatted)

I look at this and feel an inner warmth because Perl is not simply
copying the {values} from the parent to the child, it's copying a
reference. Basic stuff.

Then I have a sneaky thought: what if I instantiated the children with
a reference to the parent, which happened to be an empty hashref. Then
I could fill in the parent's values at the very last second and have
the children automatically see them.

However, this doesn't work. What happens is this: the FIRST child
that's instantiated ( $parent->{elements}->[0] above) has
$parents->{elements}->[0]->{values}->{}  and succeeding children have
$parents->{elements}->[ $i ]->{values}->{ $VAR1->{elements}[0] }
Changing $parent->{values} at the last second thus does nothing at all
to the children.

( horrible comments about children not inheriting the values of their
parents will be ignored )

Can you tell me why an empty hashref is treated differently than a
populated one in this instance?

-- 
Chris Winters
Internet Developer    INTES Networking
cwinters@intes.net    http://www.intes.net/
Integrated hardware/software solutions to make the Internet work for
you.


------------------------------

Date: Tue, 9 Jun 1998 01:51:10 +0100
From: "Jeremy Goldberg" <jgoldberg@dial-put_dot_here-pipex.com>
Subject: Re: Preventing file conflicts
Message-Id: <6li0vp$jk7$1@soap.news.pipex.net>

>Oh my god, Jeremy - WHAT HAVE YOU DONE?  You dare, you DARE to question?
>Lurk a while and you'll see that Mr. Christiansen's epithets and
>name-calling are pretty much the bread-and-butter of c.l.p.m.  Your sin in
>this regard may well be unforgivable - in fact, it would not surprise me in
>the least to find that your insolence leads to an awe-inspiring
>demonstration of unholy "killfile" might!
>Stay tuned, however........ I am learning a lot every day just by reading
>the posts - even those of the aforementioned Perl guru; usually, embedded
>somewhere in his puling nonsense, you will find the answers you seek.
>Not to mention Tom P., Larry, Greg, Mark-Jason, Abigail ( hi, Abby :-) ),
>and several others who consistently offer good info and fingers (yes, on
>occasion THAT finger, but help nonetheless) pointing people in the right
>direction.  I know too little to be of much help, I just wanted to offer
>that there is a lot of good info on the newsgroup, so don't let the above
>snippy response put you off.


I know - I read the group quite a lot, and rarely post... but I can say that
this is the ONLY group I know where this sort of thing goes on - none of my
business when it happens to other people, but I don't have to take myself.
If he thinks the question is stupid (or, as in this case, the fact that I
have a *gasp* false email address), he's doesn't have to answer.




------------------------------

Date: 9 Jun 1998 01:20:04 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Preventing file conflicts
Message-Id: <6li2k4$lla$2@csnews.cs.colorado.edu>

cat <<EO_DESPAM >>spam-fodder.html
<LI>Please don't spam <A HREF="mailto:jgoldberg@dial.pipex.com"> 
Jeremy Goldberg, jgoldberg@dial.pipex.com</A>
EO_DESPAM

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, "Jeremy Goldberg" <jgoldberg@dial.pipex.com> writes:

:I know - I read the group quite a lot, and rarely post... but I can say that
:this is the ONLY group I know where this sort of thing goes on - none of my
:business when it happens to other people, but I don't have to take myself.
:If he thinks the question is stupid (or, as in this case, the fact that I
:have a *gasp* false email address), he's doesn't have to answer.

One must call a FAQ a FAQ.  Those are refuse to learn from manpages are
doomed.  They must be helped into empowering themselves, researching and
learning.  A simple grep on the pods that come with Perl will do wonders.

There is no room in this world, or this newsgroup, for the notion that
"I'm screwed into being stuck on Windows (`a tale told by an idiot...')
so I will just ask for free consulting help instead of looking things
up things in the docs on my own system."

The FAQqing will continue until education improves.  You can count
on it.  
 
--tom
-- 
    last|perl -pe '$_ x=/(..:..)...(.*)/&&"'$1'"ge$1&&"'$1'"lt$2'
    That's gonna be tough for Randal to beat...  :-)
            --Larry Wall in  <1991Apr29.072206.5621@jpl-devvax.jpl.nasa.gov>


------------------------------

Date: 9 Jun 1998 02:04:52 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: Preventing file conflicts
Message-Id: <897358385.349771@thrush.omix.com>

Jeremy Goldberg <jgoldberg@dial-but-dont-spam.pipex.com> wrote:
	>snip<
: This sounds more promising - but where is the sysopen() call documented?

	It's a builtin to access a true C open(2):

	perldoc -f sysopen

: You got it - nothing at all about the actual mechanics of what happens in
: PERL when 2 processes try to access the same file.

	Probably because it's the same as any other language.  That is, your
	basic mess if you don't lock the file in some way, flush buffers,
	etc.

-- 
-Zenin
 zenin@archive.rhps.org


------------------------------

Date: Tue, 09 Jun 1998 00:56:13 GMT
From: ames0009@tc.umn.edu (Todd C. Ames)
Subject: Re: RECOMMEND A PERL BOOK/RESOURCES ??
Message-Id: <357c85ba.1062727@news.tc.umn.edu>

On Mon, 08 Jun 1998 22:53:20 +1000, Stephan Carydakis
<step@hotkey.net.au> wrote:

>I have a background in COBOL(yeah, yeah, i've heard most of the jokes!)
>but am very interested in Perl.
>
>My wife bought me "Programming Perl" for Christmas, and I've been trying
>to learn Perl from this book. I realise its a tad beyond me(the "Grade
>Example" is still awesome in my books!) and am wondering if anyone could
>point me in the direction of a good Intermediate book that teaches Perl.
>

I would check out the book, Teach Yourself Perl 5 in 21 Days, 2nd
edition.  It's put out by Sams Publishing.  Yeah, the 21 day part is a
joke, but don't let the title fool you;  it is a very good book,
despite the lame title.  It is a good book for anyone just starting
out in Perl.  I think the so-called "llama" and "camel" type books are
a little too advanced for the beginner.  

I don't think C++ is necessary (for learning Perl - that doesn't mean
it would hurt).  But you could learn Perl 5 just as easily as learning
C++ - so why do both if your goal is to learn Perl 5?  

Well, that's one man's opinion anyway.

T. Ames

>>>>>>>>>>>>>>>>>>>
Todd C. Ames
ames0009@tc.umn.edu
University of Minnesota


------------------------------

Date: Mon, 08 Jun 1998 20:39:13 -0400
From: Patrick Hughes <pjhugh01@gwise.louisville.edu>
Subject: rexx to perl conversion
Message-Id: <357C8431.F4FC47D6@gwise.louisville.edu>

Has anyone seen, heard of, dreamt about or otherwise gained knowledge of
a REXX to perl translator...

I figured IBM would have shipped something like that with AIX, but nope.

Thanks



------------------------------

Date: 9 Jun 1998 01:11:36 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: rexx to perl conversion
Message-Id: <6li248$lla$1@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, 
    Patrick Hughes <pjhugh01@gwise.louisville.edu> writes:
:Has anyone seen, heard of, dreamt about or otherwise gained knowledge of
:a REXX to perl translator...
:
:I figured IBM would have shipped something like that with AIX, but nope.

No, there isn't one.

You might look at this, though:

    http://www.perl.com/CPAN/doc/misc/tips/rexx.pattern.matching.in.perl

Or this article of mine from April 1995.

--tom

>From:         Tom Christiansen <tchrist@cs.Colorado.EDU>
Subject:      Re: How novice/casual Unix users might use REXX there
Reply-to:     tchrist@cs.colorado.edu (Tom Christiansen)
Organization: University of Colorado, Boulder
Newsgroups:   comp.unix.user-friendly

Attributions:

michael@mail.ast.cam.ac.uk (Michael Lemke)  	==> "michael> "
David Barr <barr@pop.psu.edu> 			==> "barr>    "
Anil Joshi <joshi@cs.uiuc.edu> 			==> "joshi>   "
Tom Christiansen <tchrist@cs.Colorado.EDU> 	==> "tchrist> "



tchrist> *  real versus effective IDs
joshi>   I don't know about this. Could you please point me to some documentation?
barr>    Pick up any good UNIX design book.

michael> Still a bit too simplistic.  How about granting different privileges
michael> instead of none or all?  The chgrp and setuid bits I've never seen to be
michael> used for much more than just giving all (i.e., root) privileges to some
michael> programs that need it.  Ok, ps does it a bit more clever, on a Sun at
michael> least.

It *is* used for that.  The Principle of Least Privilege dictates that
when it comes to having a privileged program around, you should set its
privilege level as follows, in increasing order of undesirability:

    1. entirely non-privileged
    2. setgid to a dedicated account
    3. setuid to a dedicated account
    4. setuid to the superuser

Just because people are lazy and opt for #4 doesn't mean that 
#2 and #3 aren't around.


tchrist> *  making all files just byte streams
joshi>   
joshi>   I don't see this to be a great advantage.
barr>    
barr>    It's a tremendous advantage.  It makes things more consistent and
barr>    modular.   

[ELISION]

michael> True.  But if I need an ISAM file I have to reinvent the wheel.  And
michael> this goes for a lot of Unix' programming.

We have *libraries* for specialized file formats.  What's wrong with that?
It's infinitely better than saddling the operating system with it.  For 
example, in UNIX, we have termcap and dbm libraries.  Thank God it's not
in the operating systems.


tchrist> *  umasks
tchrist> *  using file modes on directories
joshi>   These are not at the same level of granularity one would like to have.
joshi>   No access lists, no grant of privileges to others etc.

It's true that there aren't ACLs, but setuid and setgid certainly grant
access to others.

barr>    True, but it was a big step up for the day.  Even modern systems designed
barr>    today don't have ACL's.

michael> Really sad.  So don't buy them.  And in Unix it is pure luck if your
michael> file ends up with protections specified in the umask.  

That's not so.  Your umask will guarantee which bits WON'T be turned on
whenever files get created with a default mode.

michael>  Ever tried rcp,
michael> or ftp's mget?  Do a tar to move a tree from disk to disk and unless you
michael> used a special flag (which of course you don't know because it is
michael> rarely needed) the original protections are screwed.  Use cp and maybe
michael> you get the right thing.  

You're confusing some things here.  First of all, ftp isn't a UNIX thing.
It's a much more generic Internet protocol, one with its own RFC and
everything.  It runs on many kinds of systems, including those without
any kind of permission scheme.

Secondly, rcp and cp will copy modes to new files, but not overwrite
changed permissions on existing ones unless you specify -p.  They both
seem to work the same way here to me.

The rdist program, on the other hand, does try to maintain permission
bits, so for rcp to a remote host, I for this and stronger reasons
prefer to specify:

    rdist -c file remote:

michael> Specify special default protections on a
michael> directory basis?  Bad luck.

You don't inherit permissions from directories.  They're for separate
things.  Plus if you have the mode on the directory right, you don't 
need to inherit it.  Modes like 0711, 0705, and 1777 on directories
can provide for some rather interesting possibilities.

michael> And here is the real design flaw I always cringe since I've seen it for
michael> the fist time:  *I* have to add *bits* and convert them to *octal* to
michael> get the umask value!  Amazing I don't have to specify the bit pattern of
michael> the file name as well.  I should definitely learn the machine code (hope
michael> we don't get new hardware).  I just refuse to learn anything that
michael> primitive!  These aren't the days with flashing CPU register lamps on
michael> the front panel and the 16 odd switches to set them.

You just aren't happy that the shell interfaces are nearly the same as
the kernel interfaces. (They differ slightly in that for various
reasons, the shells convert the number to octal even without a leading 0.)
This is not a UNIX "design flaw".  They just wanted to make it the same
for the shell programmer as for the C programmer.  All you have to do to 
ameliorate this is update your shell's built-in umask command, or better
yet, make another command that just does the conversion.  You'll have to 
decide on the interface though:

    $ umask `perm   rwxr-xr-x`  # probably a bad idea
    $ umask `uperm  ----w--w-`
    $ umask `perm  !----w--w-`

tchrist>     *  putting globbing in the shell not the program
joshi>   There are limits to the total number of chars globbed file names can expand 
barr>    The beauty of putting globbing is the shell is to maintain consistent
barr>    globbing between any and all programs.  If you want your own globbing
barr>    (so "**" means "all files" and "*/" means "all directories" for example)
barr>    you don't have to change every single program in UNIX.  You just have
barr>    to change your shell.

michael> So I have to reinvent the stuff if my program wants to do the same.  

Of course not.  You call the shell of your choice to get the globbing behavior
that you want.  That way the codes in only one place.  Much better that way.

michael> Why
michael> isn't there are library routine used by every serious program?  (Don't
michael> tell me I can get it from GNU or ftp.x.y.z.)  Would make for much more
michael> consistency.  I call this shortsighted.  A shared library would make for
michael> easy change of the globbing behavior of every program if there were such
michael> a thing as a shared library for "higher system calls", i.e, not the
michael> primitive ones you see in section 2.

Use what you have.  Stop looking so hard.  It's already there.  :-)

Does no one remember /etc/glob?  Sigh.

Now, I admit that for the sake of efficiency, I would like a decent
globbing routine that at least handled ksh-style globbing, that is,
csh-style globbing so I get tilde and curleys, but which fixed the */
problem.  There's a GNU version, but apparently I'm not allowed to 
mention that.  (Plus I'd like one which weren't GPVd.)

michael> It is this sort of stuff (GNU's getline or how that was called) which
michael> needs to be *designed* into the OS from the start and not put on top of
michael> it later and hope it is being used especially if the vendor doesn't ship
michael> it.

Probably, although getline() should arguably be in the tty driver, not the
applications.  You need user-loadable streams modules for that kind of
thing.  Some systems provide this.  Just don't you dare go sticking it in
every application.

--tom


-- 
    "I never met a chocolate I didn't like." 
	--Deanna Troi, ST:TNG


------------------------------

Date: Tue, 09 Jun 1998 00:04:40 GMT
From: Justin Vallon <vallon@bear.com>
Subject: Re: Script Auto-restart - using -M file test - Cannonical way?
Message-Id: <x6ebts3o2xz.fsf@pearl.bear.com>

pynq@midway.uchicago.edu (Jeremy Mathers) writes:

> Is there?

a) You might restart too early.  The file might not be complete, or the 
   complete update may be several files (main.pl, lib.pm, other.pm).

b) You'll have to -M all the use'd files as well.

You can get more control by using a control file 
(~user/restart/foo.restart).  touch the restart file to restart.

Then, you can restart at will, as well.

Also, non-owners (of the script) can run and restart when they want.

But then, it's not auto-restart, is it?

-- 
-Justin
vallon@bear.com


------------------------------

Date: 9 Jun 1998 01:42:22 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: Setting @INC as needed
Message-Id: <897357035.605542@thrush.omix.com>

Morgan Fletcher <morgan@hahaha.org> wrote:
	>snip<
: Is it a valid strategy to try to deduce the location of the script and then
: set @INC accordingly?

	use FindBin;
        use lib "$FindBin::Bin/../lib";

	See perldoc FindBin for details, it's in the standard lib.
-- 
-Zenin
 zenin@archive.rhps.org


------------------------------

Date: 9 Jun 1998 00:24:26 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: setting precision???
Message-Id: <6lhvbq$h5p$1@comdyn.comdyn.com.au>

In article <357560AF.35A095F6@pilot.msu.edu>,
	Brian Genisio <genisiob@pilot.msu.edu> writes:
> Being a C++ guy, I usually use setprecision to format my money to two
> decimal places.  For the life of me, I cannot figure out how to do that
> in perl 5.  Please help me!!!!!

No need to shout.

# perldoc -f sprintf

In other words: use the sprintf builtin function.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | The world is complex; sendmail.cf
Commercial Dynamics Pty. Ltd.       | reflects this.
NSW, Australia                      | 


------------------------------

Date: 9 Jun 1998 00:47:18 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: use strict vs. iterative filehandles?
Message-Id: <6li0mm$hk8@news-central.tiac.net>

In article <6lhrs4$d4b$1@wolfman.xtra.co.nz>,
Thomas Wernitz <NOSPAM.thomas_wernitz@tait.co.nz> wrote:

>release strict refs around the relevant code:
>
>no strict 'refs';
>pipe(...);
>use strict 'refs';

You could have a little block e.g.

  {
    no strict 'refs';

    pipe (...);
  }

which visually delimits the scope of the no strict 'refs'...

Just a thought,

Mike
-- 
mike@stok.co.uk                    |           The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/       |   PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/    |                   65 F3 3F 1D 27 22 B7 41
stok@colltech.com                  |            Collective Technologies (work)


------------------------------

Date: Tue, 09 Jun 98 20:37:33 GMT
From: NOSPAM.thomas_wernitz@tait.co.nz (Thomas Wernitz)
Subject: Re: use strict vs. iterative filehandles?
Message-Id: <6li3qj$ins$1@wolfman.xtra.co.nz>

In article <p5solfa9mh.fsf@baynetworks.com>, psmith@baynetworks.com wrote:
>Without use strict this works great; with it I get:
>
>  $ perl -w ./strict-tst
>  Can't use string ("FH0001") as a symbol ref while "strict refs" in use at
> ./strict-tst line 11.
>
>I understand from the docs why this is (more or less), but I'm unsure
>what to do about it.

simply switch off strict refs around the pipe creation:

no strict 'refs';
pipe(...
use strict 'refs';

"most people would die sooner than think -- in fact, they do so."
                                                         -- Bertrand Russell


------------------------------

Date: Mon, 8 Jun 1998 22:11:09 -0400
From: "John Jeevers" <jj239733@aol.com>
Subject: Web Hosting with CGI
Message-Id: <6li5b8$10i2$1@news.gate.net>

Has anyone heard of the the following 2 Web Hosting providers. Can anyone
tell me anything about them.

PremierSite        http://www.premiersite.com
Cybergate        http://www.gate.net

Any information would be greatly appreciated. Specially if they can run cgi
scripts.




------------------------------

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 2818
**************************************

home help back first fref pref prev next nref lref last post