[8584] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2201 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Mar 28 17:07:19 1998

Date: Sat, 28 Mar 98 14:00:26 -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, 28 Mar 1998     Volume: 8 Number: 2201

Today's topics:
    Re: an extension question <ponnuraj@yahoo.com>
    Re: Directory listing question?? (Excession)
        HELP! Decimal point character in Perl 4 on SCO Unix rhardin@planethollywood.com
    Re: How to determine exe versions in Win95/NT (Nick Tonkin)
    Re: Is there a "Newsgroup" for Newbies to Perl? (Jeffrey Drumm)
        My Obfuscation (Excession)
    Re: Null Strings vs. 0 Integer Values <rootbeer@teleport.com>
    Re: Null Strings vs. 0 Integer Values <webmaster@fccjmail.fccj.cc.fl.us>
    Re: Odd-Numbered Array to Hash <rootbeer@teleport.com>
    Re: Optimisation?  Pentium 166Mhz MMX 4X slower than PP (Mike Stok)
    Re: Perl & ODBC ? <ponnuraj@yahoo.com>
    Re: Perl & ODBC ? <ponnuraj@yahoo.com>
    Re: Perl & ODBC ? <ponnuraj@yahoo.com>
    Re: Perl Libraries y2k compliance Monty@netgazer.net
        Problem running Perl ISAPI on IIS 4 <yves@ecom.be>
    Re: Problem running Perl ISAPI on IIS 4 <sowmaster@juicepigs.com>
    Re: PROPOSAL: The Perl Dictionary (Joergen W. Lang)
    Re: rant: illiterate Perl programmers (Nick Tonkin)
    Re: rant: illiterate Perl programmers (Mike Wescott)
        readkey(???) <beiti@fbg.schwerte.de>
        SUID for scripts; system(), et al. <ptrainor@bbn.com>
        Sysadmin struggeling with PERL/Sed and etc... <cyberman@sonoma.edu>
        Sysadmin struggeling with PERL/Sed and etc... <cyberman@sonoma.edu>
    Re: Sysadmin struggeling with PERL/Sed and etc... (Excession)
    Re: What does -f do? <sowmaster@juicepigs.com>
    Re: What does -f do? <mhanson@arrowweb.com>
    Re: What does this mean =~   ? (Andre L.)
    Re: Win32 Peculiars. . .Loop not working like I want! <dcameron@nospam.bcs.org.uk>
    Re: Win32 Peculiars. . .Loop not working like I want! (Nick Tonkin)
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Sat, 28 Mar 1998 16:12:37 -0500
From: Raj Ponnuraj <ponnuraj@yahoo.com>
Subject: Re: an extension question
Message-Id: <351D67C5.F07258A@yahoo.com>



Douglas Harvey wrote:

>
>
> Any opinions on the wisdom of simply having the perl scalar point
> to the "C" data buffer (possibly without a terminating NULL).

That will work ok.. I had interface with some zip libraries and I
wasable to pass binary data.. just dont use any function that depends
on a \0 at the end... such as length etc...

Regards,
Raj




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

Date: Sat, 28 Mar 1998 19:14:13 GMT
From: daclay@NOSPAMzip.com.au (Excession)
Subject: Re: Directory listing question??
Message-Id: <351e4986.42455270@news.zip.com.au>

On 22 Mar 1998 18:02:15 GMT, felicity+spam@kluge.net wrote:

>Mark Polakow <mark@imp.net> wrote:
>> Does anyone know of any way I can have Perl differentiate between files and
>> directories when it lists the content of a directory. My statement looks
>
>use the "-f" and "-d" test flags.  ie:
>

>> sub Listdir{
>> opendir(MYDIR, "$root$dir");
>> @files = readdir MYDIR;
>> foreach $file (@files) {
>	print "File: " if ( -f "$root$dir/$file" );
>	print "Directory: " if ( -d "$root$dir/$file" );
>>      print $file, "\n";


Actually, something that's incredibly tiny in the docs is the special file
"_", which saves you another STAT call, so second and subsequent tests on
the same file (like -d or -s or something) can use _.

(From the doc file)

If any of the file tests (or either the stat() or lstat() operators) are
given the special filehandle consisting of a solitary underline, then the
stat structure of the  previous file test (or stat operator) is used,
saving a system call.

(end extract)

>> sub Listdir{
>> opendir(MYDIR, "$root$dir");
>> @files = readdir MYDIR;
>> foreach $file (@files) {
             if (-f "$root$dir/$file"){ print "File:" }
             elsif (-d _ ) { print "Directory:"}   # _ is the special file!
             else
             {
                   print "Unknown?:"
             }
            print "$file\n";
}

Dac

---
David Andrew Clayton     # Please remove NO_SPAM when 
dac@NOSPAM.pcug.org.au   # sending email replies.
I post therefore I am.   #


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

Date: Sat, 28 Mar 1998 12:18:48 -0600
From: rhardin@planethollywood.com
Subject: HELP! Decimal point character in Perl 4 on SCO Unix
Message-Id: <6fjeph$f0q$1@nnrp1.dejanews.com>

Large perl4 program that generates comma-separated ascii text data files
which are, in turn, read and used by a large set of other perl 4 programs. 
Just installed this set of scripts in a French location which is running
internationalized version of SCO ODT3, and the decimal point character is a
comma instead of a period.  This is wreaking havoc with all of my programs. 
What used to be: 1,"Record 1",20.00,10.00,0.00,0.00 is now 1,"Record
1",20,00,10,00,0,00,0,00 Is there any quick and/or simple way to tell perl4
to use a period instead of a comma as the decimal point in printf/sprintf
functions?  Upgrading to perl5 (to gain acess to locale functions) is not an
option in the short term.  Changing the SCO setting is probably not a good
idea (even if I can figure out how to do it), as these are point-of-sale
systems, and the French receipts and other output of the system software need
to have the comma.  I've thought of some intermediate conversions of the data
files, but it would be horrendously tedious. I'm resisting the idea of
changing the field separator as many of these programs read comma-separated
files from other sources.  Any and all suggestions gratefully accepted. 
Please cc your reply to my email address, if you could.

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


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

Date: Sat, 28 Mar 1998 18:20:52 GMT
From: nick@NOSPAMTHANKSciof.sbcc.net (Nick Tonkin)
Subject: Re: How to determine exe versions in Win95/NT
Message-Id: <351d3f5f.132851630@news.silcom.com>



Win32::AdminMisc does this. It's on CPAN or at www.roth.net

Hope this helps

nick

On Fri, 27 Mar 1998 16:05:26 -0600, qvanegeren@frxsoft.com wrote:

>I have a bunch of executables in a directory and I need to figure out the
>Version of all of the executable files.  I know that there HAS to be a way to
>do this in PERL.  Does anybody have any ideas on how I could get this
>information from the files?  Any help would be greatly appreciated.  Thanks in
>advance for any suggestions you may have...
>
>Quenten Van Egeren
>
>-----== Posted via Deja News, The Leader in Internet Discussion ==-----
>http://www.dejanews.com/   Now offering spam-free web-based newsreading



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

Date: Sat, 28 Mar 1998 18:58:54 GMT
From: drummj@mail.mmc.org (Jeffrey Drumm)
Subject: Re: Is there a "Newsgroup" for Newbies to Perl?
Message-Id: <351d3d91.521782559@news.mmc.org>

On Fri, 27 Mar 1998 21:12:10 -0800, Denis Goddard <dgoddard@us.oracle.com>
wrote:

(snip)

>Tom Christiansen wrote:
>> 
>> Nonprogammers should not use any programming language.   Period.
>> Nonsurgeons should perform any surgical interventions.  Period.  This is
>> a profession, you know.  If you aren't a programmer, hire one.
>> 
>
>Which is interesting in light of the fact that he is quoted at
>http://webreview.com/97/02/28/feature/perl.html
>as having said in an interview:
>>
>>Dale Dougherty: If I'm not a programmer, is Perl a good place to start? Tom?
>>
>>Tom C.: It certainly can be a good place to start.
> [...]
>>Real smart
>>people sat around in ivory towers for years doing the hard work -- now you
>>get to use the fruits of their labors.
>>
>
>But of course, Larry's got a relevant quote:
>>"Sometimes I wish I could put an expiration date on my quotes." --Larry Wall
>
>You guys are the greatest!     :-)

Not sure I understand your point, since no one is a programmer until he/she
starts to program.

Tom's recent comments don't contradict his quote above; it's those folks
that refuse to learn the fundamentals of programming (with Perl, Pascal,
Logo, whatever . . . the language is nearly irrelevant) but expect, even
demand to be productive (and respected!) that undoubtedly piss him off. 

"Doctor, my wife's been coughing up blood since I tried to excise the tumor
on her left lung. I need you to tell me what to do to fix it, but I don't
want to spend 8 years becoming a thoracic surgeon. Huh? What do you mean
I'm an idiot!?! I'll have you know I'm the best diesel engine mechanic this
side of the Mississippi! You can't treat me like that!"

-- 
                           Jeffrey R. Drumm, Systems Integration Specialist
                                  Maine Medical Center Information Services
                                     420 Cumberland Ave, Portland, ME 04101
                                                        drummj@mail.mmc.org
"Broken? Hell no! Uniquely implemented." -me


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

Date: Sat, 28 Mar 1998 18:46:30 GMT
From: daclay@NOSPAMzip.com.au (Excession)
Subject: My Obfuscation
Message-Id: <351d4355.40870395@news.zip.com.au>

I wrote this to hassle someone.

#yikes
sub r
{$m=2147483647;$q=127773;$a=16807;$r=2836;$h=$s1/$q;$l=$s1%$q;$t=$a*$l-$r*$h;if($t>0){$s1=$t}else{$s1=$t+$m}}
$s1=$s2=44;$l2=1;
@c=qw(163 19 54 570 330 221 7 361 255 164 164 115 
               266 330 361 19 231 9 255 33 62 570 7 263 263);
for (my $l=0;$l<$#c;$l++)
{
  &r($l2++)while($l2<=($c[$l])-1);
  $b .=chr(&r($l2) % 256);$s1=$s2;$l2=1;
}  
eval(lc($b));
__END__

This program merely prints out "Hello_Thrase!" (no quotes)  If you just
look at (as in print out) $b instead of using eval, you'll see that the $b
string is just   'printf"hello_thrase\n";'

But the trick is to work out how I got the stuff into $b!

The only BIG hint I'll give you is : 

(don't read this until you've tried to suss it out  [ROT13'd]).

gung gur fhoebhgvar e vf zl bja ENAQ ebhgvar, naq vg ernyyl qbrf erghea
enaqbz ahzoref.

Enjoy.

Dac (neophyte perl hacker.)


---
David Andrew Clayton     # Please remove NO_SPAM when 
dac@NOSPAM.pcug.org.au   # sending email replies.
I post therefore I am.   #


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

Date: Sat, 28 Mar 1998 10:11:34 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: James Watson <james_vs_watson@yahoo.com>
Subject: Re: Null Strings vs. 0 Integer Values
Message-Id: <Pine.GSO.3.96.980328100830.22321U-100000@user2.teleport.com>

On Sat, 28 Mar 1998, James Watson wrote:

> Is there a way to examine a variable to figure out if it is a null
> string?

You mean an empty string? Sure...!

    if (not defined $fred) {
	print "it's not even defined\n";
    } elsif ($fred eq '') {
	print "it's an empty string\n";
    } elsif (ref $fred) {
	print "it's a reference: $fred\n";
    } else {
	print "it's got a value: '$fred'\n";
    }

Hope this helps!

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



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

Date: Sat, 28 Mar 1998 18:38:53 GMT
From: Webmaster <webmaster@fccjmail.fccj.cc.fl.us>
Subject: Re: Null Strings vs. 0 Integer Values
Message-Id: <351D4256.A0595C9B@fccjmail.fccj.cc.fl.us>

Ronald J Kimball wrote:

> Webmaster wrote:
> >   I believe you want to do
> > $value == 0    or
> > $vlue eq '0'     versus
> > if ($value eq null)  ???
>                 ^^^^
>
> What is that?  The null string in Perl is written as '' (or similarly with
> another quoting mechanism).
>
> print "Null string" if $value eq '';
> print "Not null string" if $value ne '';
>
> Note that this will also print "Null string" for an undefined value.
>
> --
>  _ / '  _      /         - aka -             rjk@coos.dartmouth.edu
> ( /)//)//)(//)/(    Ronald J. Kimball           chipmunk@m-net.arbornet.org
>     /                                   http://www.ziplink.net/~rjk/
>         "It's funny 'cause it's true ... and vice versa."

Oops!

Can I vote for a new word?  :-)

(I was thinking null and undefined at the same time. Sorry :-)
Sneex :-)



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

Date: Sat, 28 Mar 1998 10:28:16 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: ? the platypus {aka David Formosa} <dformosa@st.nepean.uws.edu.au>
Subject: Re: Odd-Numbered Array to Hash
Message-Id: <Pine.GSO.3.96.980328102059.3686A-100000@user2.teleport.com>

On 28 Mar 1998, ? the platypus {aka David Formosa} wrote:

> >		my ($key,$value) = split /:/;
> >		$data{$key} = $value;
> 
> I keep feeling that the above is very unperlish.  Something so often used
> and idomatic should be squeesed onto one line.  Can anybody suggest a
> better way of doing it?

I'd probably use something like this:

    @lines = qw(name:Art phone: email:art@vandelay.com);

    %data = map { /(\w+):(.*)/ } @lines;

No odd numbers there. Hope this helps!

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




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

Date: 28 Mar 1998 19:36:33 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: Optimisation?  Pentium 166Mhz MMX 4X slower than PPC 604 120Mhz?
Message-Id: <6fjjg1$jc5@news-central.tiac.net>

In article <351C7DBE.39D7A9AA@squiz.co.nz>,
Andrew McNaughton  <andrew@squiz.co.nz> wrote:
>I've got a piece of perl code that I was about to start optimising, since it
>will be run intensively.
>
>I ran it on my Mac, and it did 10,000 iterations in 36 seconds.  I expected my
>Laptop to run at a similar speed, but it takes 140 seconds to do the same
>10,000 iterations.
>
>I'm surprised that it runs so much slower, and wonder if there's some sort of
>optimisation that I should have enabled when compiling perl for this machine. 
>Any suggestions?  I've told the perl installer to use -O2 with gcc, but
>perhaps there's some other flags to optimise perl for my processor?  Perhaps
>there's another compiler that will do better?
>
>Obviously there are faster ways to search the same bit of text repeatedly, but
>first I want to make sure that perl itself is running optimally.

Have you considered looking at the match_any routine at the end of
http://www.perl.com/CPAN-local/doc/FMTEYEWTK/regexps.html which might make
the perl go faster anyway?

If you help perl out with that then you can optimise the compilation of
the interperter as well later.

Yes, I ducked the apples to oranges optimisiation question...

Hope this helps,

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: Sat, 28 Mar 1998 16:06:53 -0500
From: Raj Ponnuraj <ponnuraj@yahoo.com>
To: spittet@bluewin.ch
Subject: Re: Perl & ODBC ?
Message-Id: <351D666D.14C81661@yahoo.com>



Pittet Sibastien wrote:

>  * Make dynamic HTML pages
>  * Use an Access 97 file (mdb) on NT SERVER
>
> But, i know nothing in Perl. I'm looking for a list of software I need
> to make CGI's scripts.
>
> I've a PC with an NT 4 Server and the HTTP server from Microsof (IIS).
>

http://www.activestate.com...You can find info on both cgi and Perl IIS....

Have fun,
Raj




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

Date: Sat, 28 Mar 1998 16:06:59 -0500
From: Raj Ponnuraj <ponnuraj@yahoo.com>
To: spittet@bluewin.ch
Subject: Re: Perl & ODBC ?
Message-Id: <351D6673.309786A2@yahoo.com>



Pittet Sibastien wrote:

>
>
>  * Make dynamic HTML pages
>  * Use an Access 97 file (mdb) on NT SERVER
>
> But, i know nothing in Perl. I'm looking for a list of software I need
> to make CGI's scripts.
>
> I've a PC with an NT 4 Server and the HTTP server from Microsof (IIS).
>

http://www.activestate.com...You can find info on both cgi and Perl IIS....

Have fun,
Raj




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

Date: Sat, 28 Mar 1998 16:07:15 -0500
From: Raj Ponnuraj <ponnuraj@yahoo.com>
Subject: Re: Perl & ODBC ?
Message-Id: <351D6683.285C936@yahoo.com>



Pittet Sibastien wrote:

>
>
>  * Make dynamic HTML pages
>  * Use an Access 97 file (mdb) on NT SERVER
>
> But, i know nothing in Perl. I'm looking for a list of software I need
> to make CGI's scripts.
>
> I've a PC with an NT 4 Server and the HTTP server from Microsof (IIS).
>

http://www.activestate.com...You can find info on both cgi and Perl IIS....

Have fun,
Raj




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

Date: Sat, 28 Mar 1998 14:52:01 GMT
From: Monty@netgazer.net
Subject: Re: Perl Libraries y2k compliance
Message-Id: <351d0e74.2737676@news.netgazer.net>

On Thu, 26 Mar 1998 10:41:36 -0600, type40@tardis.ed.ac.uk wrote:

The perl homepage has a statement that Perl has no y2k issues


>The standard Perl libraries (as of Perl v5.003) all *seem* to be Y2K
>compliant.  Some of the libraries on CPAN aren't, though.  (eg Net::SNPP,
>Net::NNTP, although these could be protocol problems).
>
>I trawled dejanews looking for a post like this, on whether the libraries
>packaged with Perl (not perl itself) were y2k compliant.  Haveing checked all
>uses of gmtime and localtime in the perl libraries, I want to save anyone else
>the same bother.
>
>I have only checked uses of gmtime and localtime, so if any of the libraries
>are using 'year' variables that don't somehow use one of these functions, they
>could still fall foul.  And I've only looked at the code, not run them through
>a proper test.
>
>
>-----== Posted via Deja News, The Leader in Internet Discussion ==-----
>http://www.dejanews.com/   Now offering spam-free web-based newsreading



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

Date: Sat, 28 Mar 1998 19:41:02 -0000
From: "Yves Sucaet" <yves@ecom.be>
Subject: Problem running Perl ISAPI on IIS 4
Message-Id: <6fjg2i$k7l$1@inf6serv.rug.ac.be>

When I access a .pl file on my webserver, I get a dialog box which asks if
would like to open or save the file? I don't want to do either! I want the
file to be executed on the webserver itself (IIS4 on NT4). When I compile
the script from the command line I get no errors.

I have in
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W3SVC\Parameters\Script
Map a key with the Name ".pl" set to "D:\Perl\bin\PerlIS.dll". The file is
indeed located there and the d:\perl\bin directory has been added to my
path.

No why can't I run these .pl CGI-script? What am I doing wrong? Or is IIS4
simply not supported?

TIA,

Please cc to me privatly at yves@ecom.be

Yves Sucaet
Alcatel e-COM





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

Date: Sat, 28 Mar 1998 15:06:04 -0500
From: Bob Trieger <sowmaster@juicepigs.com>
To: Yves Sucaet <yves@ecom.be>
Subject: Re: Problem running Perl ISAPI on IIS 4
Message-Id: <351D582C.4F72@juicepigs.com>

Yves Sucaet wrote:
> 
> When I access a .pl file on my webserver, I get a dialog box which asks if
> would like to open or save the file? I don't want to do either! I want the
> file to be executed on the webserver itself (IIS4 on NT4). When I compile
> the script from the command line I get no errors.

This is not a perl problem if your code works from the command line.

You may have better luck asking your question in a cgi or webserver
newsgroup.


HTH
Bob Trieger
sowmaster@juicepigs.com


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

Date: Sat, 28 Mar 1998 19:26:49 +0100
From: joergen.lang@schwaben.de (Joergen W. Lang)
Subject: Re: PROPOSAL: The Perl Dictionary
Message-Id: <1d6m79y.jhuqa01ravwokN@host049-206.seicom.net>

Uri Guttman <uri@sysarch.com> wrote:

> p.s. i am hereby asking for permissions to put on my web site those
> definitions. i will just format definitions into table with no editing
> and full attributions to the authors. i will pay 100% of the fees stream
> of with a viewing charge of $0.00. is that fair to you authors?

Under these conditions permission is granted - and you shall have 40 %
of the viewing charge. Ain't that generous ? :-)

Joergen
-- 
-------------------------------------------------------------------
   "Everything is possible - even sometimes the impossible"
             HOELDERLIN EXPRESS - "Touch the void"
-------------------------------------------------------------------


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

Date: Sat, 28 Mar 1998 18:18:01 GMT
From: nick@NOSPAMTHANKSciof.sbcc.net (Nick Tonkin)
Subject: Re: rant: illiterate Perl programmers
Message-Id: <351d3e9b.132655889@news.silcom.com>


On 28 Mar 1998 14:47:39 GMT, laird@dock.ecn.purdue.edu (Kyler Laird)
wrote:

>Hal Snyder <hal@vailsys.com> writes:
>
>>It's not just Perl programmers - "it's"/"its" dyslexia is endemic.
>
>>What's next? Her's and your's?

How about the UMAX scanning software I installed yesterday telling me
to "reboot before the changes take affect" . . . ?


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

Date: 28 Mar 1998 16:47:04 -0500
From: wescott@cygnus.ColumbiaSC.NCR.COM (Mike Wescott)
Subject: Re: rant: illiterate Perl programmers
Message-Id: <x4vhsysd2f.fsf@cygnus.ColumbiaSC.NCR.COM>


> What's next? Her's and your's? Sad times we're living in...

Nuffin wrong with that. Clearly those are contractions for "her is"
and "your is". :-)

-- 
	-Mike Wescott
	 mike.wescott@ColumbiaSC.NCR.COM


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

Date: Sat, 28 Mar 1998 22:22:42 GMT
From: Sebastian St|we <beiti@fbg.schwerte.de>
Subject: readkey(???)
Message-Id: <351D7832.7608@fbg.schwerte.de>

Sebastian St|we wrote:
 
 Hi NG !
 
 Can anyone give me a hint about a function named readkey() or sth like
 that ? I'd like to read keys from the keyboard, but print stars on
 screen (enter a pw, sth like that).
 
 Thanks,
 
 Beiti /Sebastian/
 --
                                      ("`-''-/").___..--''"`-._
 Beiti                                 `6_ 6  )   `-.  (     ).`-.__.`)
 beiti@fbg.schwerte.de                 (_Y_.)'  ._   )  `._ `. ``-..-`
 beiti@gmx.net                       _..`--'_..-_/  /--'_.' ,'
 ___________________________________(il),-''  (li),'  ((!.-'

-- 
                                     ("`-''-/").___..--''"`-._        
Beiti                                 `6_ 6  )   `-.  (     ).`-.__.`)
beiti@fbg.schwerte.de                 (_Y_.)'  ._   )  `._ `. ``-..-` 
beiti@gmx.net                       _..`--'_..-_/  /--'_.' ,'         
___________________________________(il),-''  (li),'  ((!.-'



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

Date: Sat, 28 Mar 1998 17:35:48 -0500
From: Pat Trainor <ptrainor@bbn.com>
Subject: SUID for scripts; system(), et al.
Message-Id: <Pine.LNX.3.95.980328173136.23559B-100000@aura>


	Situation: 

	script to add new users to a system works great as root. I cannot
get the script to run as SUID root, however without error, this is
regardless of setting SUID on the script. 

	Example:

$foo = system("passwd $login");

	This line will not work unless the user running the script is
root.

	Is the solution to call another script that is SUID root with just
one line in it? This seems so silly a question. The script is to allow
non-root users to add users.

	BTW: the script uses ssh to check other servers for UID's as well
as checking the submitted login for proper format. Anyone interested, I'll
email them the script.

pat 	
:)

Pat Trainor
              System Administration - BBN Technologies
         Network Operations - BBN Planet/GTE Internetworking 
________________________________________________________________________
__     __        _      _______________________      __      __   ___  _
_  _________  ____  ______GTE_Internetworking__  ___  _  ___  _    __  _
_  __   ____  ____    _________________________      __      __  _  _  _
_  ___  ____  ____  ________Powered_by_BBN_____  ___  _  ___  _  __    _
__      ____  ____      _______________________      __      __  ___   _
________________________________________________________________________
     ptrainor@bbnplanet.com ptrainor@bbn.com ptrainor@bbnplanet.net
                         will program for boat 



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

Date: Sat, 28 Mar 1998 11:30:32 -0800
From: "David C. McCall" <cyberman@sonoma.edu>
Subject: Sysadmin struggeling with PERL/Sed and etc...
Message-Id: <351D4FD8.EC60DB2C@sonoma.edu>

This is a multi-part message in MIME format.
--------------B5C3D68413CF8DB09F6C6B33
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

I've got 2 files each with the same number of lines of text.
I would like to merge these files line by line appending the 2nd files
1st line to the 1st files 1st line, and so on....to a 3rd file.....

I guess this seems to be a simple type of problem (at least I thought
it was until I started trying to imagine what sets of commands and which
application would be easier to use....)....
I guess I'm just burned out on this problem...
but I really would be appreciative if anyone might lead me to something
that could put this in a clearer view...\
thanks ahead of time
egrep xargs mawking sscripter
dmccall
cyberman@sonoma.edu
--------------B5C3D68413CF8DB09F6C6B33
Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for David McCall
Content-Disposition: attachment; filename="vcard.vcf"

begin:          vcard
fn:             David McCall
n:              McCall;David
org:            Sonoma State University
adr:            Information Technology/Computer Center;;1801 E. Cotati Avenue;Rohnert Park;California;94928-3613;United States of America
email;internet: cyberman@sonoma.edu
title:          Operating Systems Analyst
tel;work:       707-664-3099
tel;fax:        707-664-2505
tel;home:       707-792-0482
note:           I do CYBERtrash toooooo.
x-mozilla-cpt:  ;0
x-mozilla-html: FALSE
version:        2.1
end:            vcard


--------------B5C3D68413CF8DB09F6C6B33--



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

Date: Sat, 28 Mar 1998 11:42:22 -0800
From: "David C. McCall" <cyberman@sonoma.edu>
Subject: Sysadmin struggeling with PERL/Sed and etc...
Message-Id: <351D529E.E97D8E09@sonoma.edu>

This is a multi-part message in MIME format.
--------------7053947F9C0EDE94562433CB
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

I've got 2 files each with the same number of lines of text.
I would like to merge these files line by line appending the 2nd files
1st line to the 1st files 1st line, and so on....to a 3rd file.....

I guess this seems to be a simple type of problem (at least I thought
it was until I started trying to imagine what sets of commands and which
application would be easier to use....)....
I guess I'm just burned out on this problem...
but I really would be appreciative if anyone might lead me to something
that could put this in a clearer view...\
thanks ahead of time
egrep xargs mawking sscripter
dmccall
cyberman@sonoma.edu
--------------7053947F9C0EDE94562433CB
Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for David McCall
Content-Disposition: attachment; filename="vcard.vcf"

begin:          vcard
fn:             David McCall
n:              McCall;David
org:            Sonoma State University
adr:            Information Technology/Computer Center;;1801 E. Cotati Avenue;Rohnert Park;California;94928-3613;United States of America
email;internet: cyberman@sonoma.edu
title:          Operating Systems Analyst
tel;work:       707-664-3099
tel;fax:        707-664-2505
tel;home:       707-792-0482
note:           I do CYBERtrash toooooo.
x-mozilla-cpt:  ;0
x-mozilla-html: FALSE
version:        2.1
end:            vcard


--------------7053947F9C0EDE94562433CB--



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

Date: Sat, 28 Mar 1998 20:44:53 GMT
From: daclay@NOSPAMzip.com.au (Excession)
Subject: Re: Sysadmin struggeling with PERL/Sed and etc...
Message-Id: <351f6001.48211933@news.zip.com.au>

On Sat, 28 Mar 1998 11:30:32 -0800, "David C. McCall" <cyberman@sonoma.edu>
wrote:

>I've got 2 files each with the same number of lines of text.
>I would like to merge these files line by line appending the 2nd files
>1st line to the 1st files 1st line, and so on....to a 3rd file.....

#meld
# $ARGV[0] = file 1, $ARGV[1] = file 2, $ARGV[3] = file 3
die "need args, stephanie!" if !defined($ARGV[0]);
open(F1, "<$ARGV[0]") || die "invalid input filename in $ARGV[0]";
open(F2, "<$ARGV[1]") || die "invalid input filename in $ARGV[1]";
open(F3, ">$ARGV[2]") || die "invalid output filename in $ARGV[2]";
while (1)
{
   die "end of input on file 1" if !defined($line1 = <F1>);
   die "end of input on file 2" if !defined($line2 = <F2>);
   print F3 $line1, $line2;
}
__END__   

Script does nothing clever to check that file1 and file2 are really the
same size, or that file3 doesn't exist.

>egrep xargs mawking sscripter
>dmccall
>cyberman@sonoma.edu

Dac


---
David Andrew Clayton     # Please remove NO_SPAM when 
dac@NOSPAM.pcug.org.au   # sending email replies.
I post therefore I am.   #


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

Date: Sat, 28 Mar 1998 14:59:53 -0500
From: Bob Trieger <sowmaster@juicepigs.com>
Subject: Re: What does -f do?
Message-Id: <351D56B9.2231@juicepigs.com>

Ronald J Kimball wrote:
> 
> Mike wrote:
> >
> > What does -f do?
> 
> What does reading the documentation do?

Since you ask:

purgatory:$ perldoc -f -f
No documentation for perl function `f' found


Bob Trieger
sowmaster@juicepigs.com


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

Date: Sat, 28 Mar 1998 14:47:23 -0800
From: Mike <mhanson@arrowweb.com>
Subject: Re: What does -f do?
Message-Id: <351D7DFB.22BD@arrowweb.com>

Webmaster wrote:
> 
> Mike wrote:
> 
> > What does -f do?
> 
> specifies a regex to split as if -a was in effect...
> 
> single float in native format...
> 
> file is a plain file...
> 
> Please expand upon your question...  Many possible answers exist...
> 
> HTH,
> Sneex :-)

Like while(-f file) {
-- 
--------------------------------------------
!! Custom Perl Programming !!
Visit Us At: http://mhanson.hypermart.net
--------------------------------------------


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

Date: Sat, 28 Mar 1998 12:52:48 -0500
From: alecler@cam.org (Andre L.)
Subject: Re: What does this mean =~   ?
Message-Id: <alecler-2803981252480001@dialup-575.hip.cam.org>

In article <6fhuj1$lm9$1@client2.news.psi.net>, abigail@fnx.com wrote:

> Billy (mobrien@rocketmail.com) wrote on MDCLXX September MCMXCIII...


Ah ah. Very clever.

30,
A.L.


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

Date: 28 Mar 1998 18:34:57 GMT
From: "Duncan Cameron" <dcameron@nospam.bcs.org.uk>
Subject: Re: Win32 Peculiars. . .Loop not working like I want!
Message-Id: <01bd5a78$2c246540$323763c3@dns.btinternet.com>

As posted, your question and script don't make a lot of sense.  What do you
mean by ' It takes a Carriage Return and matches it to "0" ' ?
Is the script just an example of what it is you don't understand or is it
part of a bigger script. For example, $choices is defined but  its values
are not used,

Assuming that your question is "If I enter just a return then the statement
$counter =~ $num is evaluated as true, why?" then the short answer is that
$num is treated as a regexp, it is empty, and therefore $counter matches
it.  The longer answer is that you are probably using the wrong construct. 
You need to compare the entered value, the =~  treats the rhs as a regexp. 
In your use, the result is true if the value of $counter includes the value
of $num.   I guess that you are trying to match the entered number against
those values in @choices.  Try

@choices=(3,15,24,39);
do {
    print "\nEnter a number: ";
    chomp($num=<stdin>);
}
until (grep {$num eq $_} @choices);

The loop will continue until the entered value equals one of the value in
@choices.  Note that the comparison is eq not ==, so that non-numeric input
values are handled. Also note that Perl automatically converts the numeric
values in @choices to strings for the comparison.  grep is just a
convenient method of iterating through @choices, setting $_ to each value
in turn, and executing the code between the braces.

Carry on studying Learning Perl!

HTH

Remove 'nospam.' to get my return address.

Troy Coulombe <troy.c@scsi-online.net> wrote in article
<6fibjb$kt0$1@news.yokota.attnet.or.jp>...
> NT 4.0 SP 3 with Gurusamy Sarathy's
> distribution of Perl

SNIP

> 
> The PROBLEM: It takes a Carriage Return and
> matches it to "0".  How do I prevent that? Here
> is the very non elegant script.
> 
SNIP - script removed



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

Date: Sat, 28 Mar 1998 18:33:02 GMT
From: nick@NOSPAMTHANKSciof.sbcc.net (Nick Tonkin)
Subject: Re: Win32 Peculiars. . .Loop not working like I want!
Message-Id: <351d413b.133327805@news.silcom.com>


Still not using -w or strict, huh, Troy?

Why pattern match $counter to $num?
Why not:
             if ($counter eq $num)

You could also force input like this:

      chomp(my $num=<stdin>);
      die "Please enter a number\n" if $num eq '';

Hope this helps

Nick


On Sat, 28 Mar 1998 17:23:38 +0900, "Troy Coulombe"
<troy.c@scsi-online.net> wrote:

>The PROBLEM: It takes a Carriage Return and
>matches it to "0".  How do I prevent that? Here
>is the very non elegant script.



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

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

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