[11542] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5143 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Mar 15 20:07:22 1999

Date: Mon, 15 Mar 99 17:01:36 -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           Mon, 15 Mar 1999     Volume: 8 Number: 5143

Today's topics:
    Re: Script to Grant "Log on as Service" right <epierre@e-nef.com>
    Re: Segmentation Fault (Bill Moseley)
    Re: Setting LD_LIBRARY_PATH inside perl script (Charles DeRykus)
        Somebody help me with this script please! <rollo@enter.net>
    Re: Syntax errors with PerlShop... <gellyfish@btinternet.com>
    Re: The truth about the Pentium III chip and ID --- **b (Tim Roberts)
    Re: UNIQUE variable... <wells@cedarnet.org>
    Re: Using the print << command (George Crissman)
    Re: Where to start with Perl <cassell@mail.cor.epa.gov>
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Tue, 16 Mar 1999 00:49:58 +0100
From: Emmanuel PIERRE <epierre@e-nef.com>
Subject: Re: Script to Grant "Log on as Service" right
Message-Id: <36ED9CA5.87F11E05@e-nef.com>

gary_griffith@hotmail.com wrote:

> I need to grant a particular NT domain user the right to "Log On as a
> Service" onto NT workstation - and unfortunately - I have to do it for 100's
> of NT workstations.  My first thought is to try "NET USE" commands, but they
> don't seem to cut it.  There's got to be a module already out there that can
> do this.
>
> Anyone know of it?  Is there a way to get NetAdmin or AdminMisc to work this
> out?

try this, and the link at the bottom of it ...

    http://www.e-nef.com/perl/ntperl.html

hope this help...

--
-= Emmanuel PIERRE            ICQ: 19153556         epierre@e-nef.com =-
http://www.e-nef.com/users/epierre                http://www.apr-job.com
P E R L  &  L I N U X                             http://www.parinux.org
There is never enough freedom                         QUID ME ANXIUS SUM





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

Date: Mon, 15 Mar 1999 16:13:23 -0800
From: moseley@best.com (Bill Moseley)
Subject: Re: Segmentation Fault
Message-Id: <MPG.115741ff1919b49b9896e1@206.184.139.132>

In article <7cjoaa$57t$4@client2.news.psi.net>, abigail@fnx.com says...
> Bill Moseley (moseley@best.com) wrote on MMXXI September MCMXCIII in
> <URL:news:MPG.1155e8fabac20a339896db@206.184.139.132>:
> !! I have a Perl CGI script that redirects STDERR to a log file.
> !! 
> !! I have 'Segmentation Fault' entered in my log file on a line by itself.  
> !! No other helpful info was provided.  It doesn't show up very often.
> !! 
> !! Anyone know what I'm being told?  Is that a perl problem, and anything I 
> !! can fix within my script?
> 
> 
> How should we know? You don't give any information, except for a line
> without context in soem log file.

Well, perhaps the error looks familiar to someone else?  But I appreciate 
the response, anyway.  I don't have any ideas either.  I'd be more 
verbose if I could, but as I explained, it's just a message that shows up 
on STDERR once in a while, and no other info is offered.

I'm not doing anything odd with memory that I know of or, at least, 
anything that Perl complains about -- so perhaps some odd rare bug with 
perl or Apache (it's running as a CGI script)?

What do you do when you receive an odd error message that you don't 
understand, that doesn't happen very often, doesn't supply any context, 
and it's in the STDERR output from a 150K script?  I'm ignoring it, 
mostly, but trying to stir up some ideas where I might look, if anywhere, 
in my script.  Seems like clpm might be a good choice where to ask.  No?

Is Perl generating that message?

Thanks,


-- 
Bill Moseley mailto:moseley@best.com


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

Date: Mon, 15 Mar 1999 23:27:35 GMT
From: ced@bcstec.ca.boeing.com (Charles DeRykus)
Subject: Re: Setting LD_LIBRARY_PATH inside perl script
Message-Id: <F8nt5z.25I@news.boeing.com>

In article <7chcq4$p64$1@berry.elite.net>,  <lathropj@elite.net> wrote:
>How can I set LD_LIBRARY_PATH inside perl script?
>

use Env;
$LD_LIBRARY_PATH .= ':/path/I/want/to/add';


perldoc perlfaq8 for an explanation of why this won't
affect the calling Unix shell though. 


hth,
--
Charles DeRykus


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

Date: Mon, 15 Mar 1999 18:20:52 -0500
From: "Rollo Lawson" <rollo@enter.net>
Subject: Somebody help me with this script please!
Message-Id: <36ed951c.0@news3.enter.net>

I have been trying to get a simple counter work for about a week now and Iam
fed up can someone please help me.
My web server does not support server side includes,  so i have to use an
image tag to call the counter script.
EX. <img src="http:www.whatever.net/cgi-bin/counter.pl">
This works and everything and it calls the script and imcrements the count
file, but it leaves a picture of a broken image on the screen.  And that is
no good for a supposed webmaster like myself.  I would rather have it be a
hidden counter but you cannot hide a image called by an html <img tag.  Now
I have seen some scripts that send back an image to the page and it is
displayed instead of the broken image.    I have tried this but it does not
send the image back the image stays broken.  Below is the html code then the
script.  PLEASE SOMEONE HELP!!!!!!!!!!!!


HTML CODE
____________________________________________________________________________
________________

<HTML>
<BODY bgcolor="black" TEXT="#FFFFFF">
<CENTER>
<H1>WELCOME TO OPINION.COM</H1>
</CENTER>
<HR>
<P>
Who do you think will win the fight on Saturday and why.  All post will be
added to my guestboook.

<FORM METHOD="POST" ACTION="HTTP://207.16.152.171/cgi-bin/guest.pl">
<b>
FIRST NAME: <INPUT TYPE="TEXT" NAME="firstname" SIZE="25"><BR>
<br>
LAST NAME: <INPUT TYPE="TEXT" NAME="lastname" SIZE="25"><BR>
<BR><br>
WHO DO YOU THINK WILL WIN THE FIGHT ON SATURDAY BETWEEN EVANDER HOLYFIELD
AND
LENNOX LEWIS.  YOUR REPLIES WILL BE LEFT ON THE MESSAGE BOARD.
<br>
<textarea cols=45 rows=11 name="chochatext">
</textarea><BR><BR>
<P>
<INPUT TYPE="RESET" VALUE="CLEAR">
<INPUT TYPE="SUBMIT" NAME="SUBMIT" VALUE="ENTER">

</FORM>

<center><img src="http://rollo/cgi-bin/count.pl" ></center>


</BODY>
</HTML>

____________________________________________________________________________
____________________

Perl code


!/perl/bin/perl
open(Count,"<remote.txt");
$total = <Count>;
close(Count);
$total++;
open(Count,">remote.txt");
print Count $total;
close(Count);
print "Content-Type: image/gif\n\n";
print "<img src=\"http://rollo/mirv.gif\">";

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

Help please!!!!!!


Rollo Lawson
rollo@enter.net

or rollo_lawson@yahoo.com







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

Date: 15 Mar 1999 21:10:59 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: Syntax errors with PerlShop...
Message-Id: <7cjt14$7e$1@gellyfish.btinternet.com>

On Mon, 15 Mar 1999 09:35:28 PST "John Bigbooty" wrote:
> Dear esteemed and knowledgeable Perl gurus,
Hmm
> 
<snip>
>
> syntax error in file Perlshop.cgi at line 195, next 2 tokens "chr("
> syntax error in file Perlshop.cgi at line 272, next token "["
> syntax error in file Perlshop.cgi at line 325, next token "["
> syntax error in file Perlshop.cgi at line 340, next token "["
> syntax error in file Perlshop.cgi at line 362, next 2 tokens "uc substr"
> Execution of Perlshop.cgi aborted due to compilation errors.
> 
> These program lines are as follows:
> 
> 195: $delim = chr(1);
> 272: ['US', 2.75],
> 325: [$catalog_country, 'UPS Ground', 0, 2, '+', 5.00],
> 340: [1, 3, 0.00],
> 362: if (	(uc substr($action,0,5) eq 'ENTER') ||
> 
> Thus, I am at a complete loss as to what the problem is.  The server 
> supports perl 5.00404, so it is not a version problem. 

Looks like a version problem to me .... are you sure you're getting
a Perl 5 ?  

/J\
-- 
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


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

Date: Tue, 16 Mar 1999 00:23:23 GMT
From: timr@probo.com (Tim Roberts)
Subject: Re: The truth about the Pentium III chip and ID --- **boycott info**
Message-Id: <36eea2e6.597352937@news.teleport.com>

John Lehmann <johnl@axis.com.au> wrote:

>Kano wrote:
>> 
>> Oh come on. Many other standard devices (ethernet cards, for example)
>> have their
>> own unique serial numbers that software can use at will. Get over it.
>> 
>
>Yes - but ethernet mac cards are only broadcast over the lan, not over
>the net (except by Office98, of course).

The POINT here is that it is exactly as easy to embed my unique MAC address
in an Internet transaction as it is to embed my unique Pentium-III CPU ID
in an Internet transaction.  Any software which will go to the trouble to
fetch the unique CPU identifier and send it over the network to identify me
could just as easily be written TODAY to use a MAC address for exactly the
same purpose.  The CPU identifier is not significantly different in concept
from the MAC address, and yet there has not been a hue and cry to boycott
NIC manufacturers.

>And what do you mean get over it???  This kind of personal information 
>is valuable.  Business are willing to pay for it.  This kind of 
>behavior IS DOWNRIGHT THEFT!!!

But whatever they could do with a CPU ID, they are probably already doing
with a MAC address.  It is just as good as a unique identifier.  "Get over
it" is exactly the right attitude.
--
- Tim Roberts, timr@probo.com
  Providenza & Boekelheide, Inc.


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

Date: Mon, 15 Mar 1999 23:21:26 +0000
From: Steve Wells <wells@cedarnet.org>
Subject: Re: UNIQUE variable...
Message-Id: <36ED95F6.4BC8BA2A@cedarnet.org>

Bart Lateur wrote:
> 
> Steve Wells wrote:
> 
> >I've been using: my $unique = $$.time
> 
> Problems with this can happen if there are many small processes (over
> 65000) that quit within a second. In that case, you could end up with
> the same $$ for another process, within the same second (same time()).
> 
> I expect that if you do a sleep(1) (or longer) that, at least, you keep
> hold of this $$ for at least one second, so other processes doing the
> same can NOT have the same process ID AND the same execution time, ever.
> 
> BTW what does this have to do with cookies?
> 
>         Bart.

Good points Bart, by making sure that the process takes at least
a second to run it will make sure that time is unique compared to
the PID.  Rather than sleep though would you recommend simply 
using the benchmark routines to manage the time?  This way you 
don't 'waste' a second trying to get a unique number.

The cookies part comes in when trying to save state, build counters or
track users going through the site.  Though I don't know who they are
(nor do I care) I can build statistics such as the fact that most people
click on a certain link or go to a certain page.  It helps with site 
design or so they say...

Thanks,
STEVE
-- 
-----------
Stephen D. Wells
http://www.iren.net/wellss/


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

Date: Tue, 16 Mar 1999 00:32:40 GMT
From: strads@tmisnet.com (George Crissman)
Subject: Re: Using the print << command
Message-Id: <36eda198.8219151@news2.tmisnet.com>

Yeah, I remember having problems with the print << command.
Here's what I did to solve the problem:

# ============ Version 1 ==========================
# Fussy HTML startup code
print "Content-type: text/html\n\n" ;
print "<HTML>" ;

# Easygoing HTML output
# Note:  added quote marks and semicolon to "print" line
# Also added </HEAD> tag and </HTML> tag
# Changed </TEST> to </TITLE>
# Changed closing <P> to </P>
print <<"_HTML_";           
<HEAD>
<TITLE>TEST</TITLE>
</HEAD>
<BODY>
<P>test</P>
</BODY>
</HTML>
_HTML_

# ============== Version 2 ========================
# Hint -- don't try to put everything in one print << block!
# Use the PrintTag (the part in quotes) to self-document your code!

# Fussy HTML startup code
print "Content-type: text/html\n\n" ;
print "<HTML>" ;

# Create HTML Head
print <<"TitleBlock";
<HEAD>
<TITLE>Hiya!</TITLE>
</HEAD>
TitleBlock

# Create HTML Body
print <<"BodyBlock";
<BODY LINK="#0000FF" VLINK="#000080" ALINK="#008800" 
      BACKGROUND="../img/mist.jpg"
      BGPROPERTIES="fixed"
      BGCOLOR="FFFFFF">
BodyBlock

# Show Something to Web Visitor
print <<"Info";
<H2 ALIGN="CENTER"><FONT COLOR="RED">Hiya!</FONT></H2>
Info

# Address Information
print <<"Footer";
<CENTER>
<ADDRESS>
Information provided in hopes you will decide to visit
<A HREF="http://www.tmisnet.com/~strads/stress/index.html>
The Relationship Stress Test (For Guys)</A>
</ADDRESS>
</CENTER>

# All Done
print <<"Finish";
</BODY>
</HTML>
Finish





On Tue, 02 Mar 1999 12:31:16 GMT, alastair@solarnet.co.uk wrote:

>Hi all 
>
>I'm having a bit of a problem I when I try and use the print
><<variable command to print HTML I get a error that says PERL cannot
>find the string terminator. This is the code I have. Can anyone spot
>anything I am doing wrong.  Also if its not the code causing this
>error can anyone recommend anything.
>
>print <<_HTML_
><HEAD>
><TITLE>TEST</TEST>
><BODY>
><P>test<P>
></BODY>
>_HTML_
>
>Please help as I am going insane sat here looking at this code 
>
>Thanks in advance 
>
>A;lastair brown

-----------------------------------------------------------------------
"There is no need to criminalize millions of legitimate and responsible
businesses and individuals in order to stop a very small group of
irresponsible people, particularly when there are other ways already
working ." says Mr. Dan Hufnal of the 10,000 member DEAA 
<http://www.deaa.com>. What does he mean by "already working"?
Maybe:  <http://www.tmisnet.com/~strads/spamhunt/index.html>
-----------------------------------------------------------------------


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

Date: Mon, 15 Mar 1999 15:38:09 -0800
From: "David L. Cassell" <cassell@mail.cor.epa.gov>
Subject: Re: Where to start with Perl
Message-Id: <36ED99E1.5EEF078D@mail.cor.epa.gov>

Jay Glascoe wrote:
> [courtesy copy of post sent to cited author]
> Tom Kralidis wrote:
> > At the risk of getting smart-alec replies, does anyone have any good
> > starting points for someone wanting to learn Perl.  I have a good handle
> > of UNIX (awk, grep, sed), some C/C++ and have heard nothing but good
> > things about Perl.  I would like to enhance my data manipulation
> > capabilities and productivity among other things.
> 
> print << 'IMHO';
> 
> I think you'll find _Programming_Perl_ an invaluable reference.
> Since you have programming experience, you'll probably be able
> to learn Perl (or a good subset of it anyway) from that book alone
> (well, the FAQs and online docs help too).
> 
> For *real world* Perl examples, I highly recommend the _Perl_Cookbook_.
> If ya got the money, buy both books.  You won't be disappointed.
> 
> IMHO

I agree with Jay (as usual :-).  But let me add another suggestion.
In case you peek in 'Programming Perl' and find it a little too
daunting, there is always 'Learning Perl' by Randal Schwartz.  A
great text too.

But then, I have all three of these.  Boy, is Tim O'Reilly scoring 
off me!  You know you're coughing up bucks when you actually have
an O'Reilly mobile hanging in your house...  :-)

David
-- 
David L. Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>


Administrivia:

Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing. 

]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body.  Majordomo will then send you instructions on how to confirm your
]subscription.  This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V8 Issue 5143
**************************************

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