[16549] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3961 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Aug 9 09:10:29 2000

Date: Wed, 9 Aug 2000 06:10:20 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <965826619-v9-i3961@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Wed, 9 Aug 2000     Volume: 9 Number: 3961

Today's topics:
    Re: is mysql faster using Perl or PHP? <bart.lateur@skynet.be>
    Re: is mysql faster using Perl or PHP? (Rafael Garcia-Suarez)
        keeping a script alive. <laf@gameonline.co.uk>
    Re: keeping a script alive. (Chest Rockwell)
    Re: keeping a script alive. (Rafael Garcia-Suarez)
    Re: keeping a script alive. mj.stevenson@auckland.ac.nz
    Re: keeping a script alive. (Marcel Grunauer)
    Re: keeping a script alive. <laf@gameonline.co.uk>
    Re: keeping a script alive. <guenther.degenfelder@datev.de>
    Re: keeping a script alive. (Tony L. Svanstrom)
        lamer problem of commiting a perl script <elbereth*nospam*@gmx.de>
    Re: non-blocking TCP connect()? (Anno Siegel)
        Oracle connectivity using Perl <peter_gadsbyNOpeSPAM@hfcbank.co.uk.invalid>
    Re: password protected web pages which? <ian.stuart@ed.ac.uk>
        Perl 5.6.0 doesn't install on NetBSD/i386 1.4.2 <md7141@bris.ac.uk>
        Perl and PWS Redux <jkearmanNO@mindspring.com>
        Perl External Program Question vagabond_nomad@my-deja.com
    Re: perl job newsgroup <elephant@squirrelgroup.com>
        Perl/CGI External Program Question vagabond_nomad@my-deja.com
    Re: Problem with Net::Telnet <guenther.degenfelder@datev.de>
        setuid root perl script bolero92@my-deja.com
    Re: setuid root perl script (Rafael Garcia-Suarez)
    Re: setuid root perl script (Anno Siegel)
        sh: lst2: Generated or received a file descriptor numbe mahesha@nital.stpp.soft.net
        sh: lst2: Generated or received a file descriptor numbe mahesha@nital.stpp.soft.net
    Re: sh: lst2: Generated or received a file descriptor n (Anno Siegel)
    Re: Simple reg expression question <bart.lateur@skynet.be>
    Re: Tk module for Windows NT guddat@gmx.de
        Using Bit::Vector for large hex-number arithmetic <uackermann@orga.com>
    Re: Using Bit::Vector for large hex-number arithmetic (Anno Siegel)
    Re: What to do with 1A(hex) in a file? <abe@ztreet.demon.nl>
    Re: When does it pay to presize an array? <mauldin@netstorm.net>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Wed, 09 Aug 2000 09:23:25 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: is mysql faster using Perl or PHP?
Message-Id: <9882psohoa2dfq0q92862oar1q9qrrgn8r@4ax.com>

brian d foy wrote:

>> Now, what is your reply to "my" (original) message? What is your idea?
>> is database connectivity with MySQL is faster in Perl or PHP?
>
>i don't even know what you are doing, or that it even matters in
>your situation.

I think he's talking about CGI. Every single request from the browser
would demand a new connection to the database. That *could* be pretty
slow. I think that that time is pretty independent on which language you
use to make this tick.

What would be better, is have an permanent connection to the dB, for
example in an independent process, and request it's info from *that*. I
dunno, but I thought that Apache+mod_perl has a way to do that. Now, if
PHP had a way to do that behind the scenes, yes it would be faster than
the plain perl, straightforward code solution. I don't know if it does.

In Perl, you could always try an approach like Randal's WebTechniques'
columns #23 and #24 (<http://www.stonehenge.com/merlyn/WebTechniques/>)
in order to get a personal server with a more permanent state -- and
connection. Slow at the first access, but fast thereafter.

-- 
	Bart.


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

Date: Wed, 09 Aug 2000 10:00:07 GMT
From: rgarciasuarez@free.fr (Rafael Garcia-Suarez)
Subject: Re: is mysql faster using Perl or PHP?
Message-Id: <slrn8p2b73.kdq.rgarciasuarez@rafael.kazibao.net>

Bart Lateur wrote in comp.lang.perl.misc:
>
>I think he's talking about CGI. Every single request from the browser
>would demand a new connection to the database. That *could* be pretty
>slow. I think that that time is pretty independent on which language you
>use to make this tick.
>
>What would be better, is have an permanent connection to the dB, for
>example in an independent process, and request it's info from *that*. I
>dunno, but I thought that Apache+mod_perl has a way to do that.

Yes -- it's called Apache::DBI. But mod_perl must be compiled into
apache and the mod_perl scripts must conform to the mod_perl coding
guidelines, that are more strict than for CGI programs.

>Now, if
>PHP had a way to do that behind the scenes, yes it would be faster than
>the plain perl, straightforward code solution. I don't know if it does.

I think mod_php can do that. But php installed as a CGI program can't
do, for sure.

So, the relevant question is: how to configure apache. And the relevant
group is comp.infosystems.www.servers.<some_platform>.

-- 
Rafael Garcia-Suarez


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

Date: Wed, 9 Aug 2000 10:36:21 +0100
From: "Neil Lathwood" <laf@gameonline.co.uk>
Subject: keeping a script alive.
Message-Id: <965813893.8501.0.nnrp-01.c246f129@news.demon.co.uk>

Hi Folks,

I have to design a script that constantly checks a database for dates, when
the current date matches the date in the database it will email a client
some information.

What I am basically after finding out is how to keep a script constantly
running on the server so that it can keep checking the dates. It only needs
to do this once a day and what sort of problems that this could cause.

--
Neil






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

Date: Wed, 09 Aug 2000 10:02:22 GMT
From: haaaajo@removethis.dds.nl (Chest Rockwell)
Subject: Re: keeping a script alive.
Message-Id: <39912b7e.65682343@news.wirehub.nl>

On Wed, 9 Aug 2000 10:36:21 +0100, "Neil Lathwood"
<laf@gameonline.co.uk> wrote:

>Hi Folks,
>
>I have to design a script that constantly checks a database for dates, when
>the current date matches the date in the database it will email a client
>some information.
>
>What I am basically after finding out is how to keep a script constantly
>running on the server so that it can keep checking the dates. It only needs
>to do this once a day and what sort of problems that this could cause.

Hi,

I think you need to run your script once a day using a scheduler. On
**IX systems this can be done using crontab (for more info type 'man
crontab'). On WinNT this can be done using the 'AT' command (for more
info type 'man at' at a command prompt).

Cheers,

Chest


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

Date: Wed, 09 Aug 2000 10:01:25 GMT
From: rgarciasuarez@free.fr (Rafael Garcia-Suarez)
Subject: Re: keeping a script alive.
Message-Id: <slrn8p2b9i.kdq.rgarciasuarez@rafael.kazibao.net>

Neil Lathwood wrote in comp.lang.perl.misc:
>Hi Folks,
>
>I have to design a script that constantly checks a database for dates, when
>the current date matches the date in the database it will email a client
>some information.
>
>What I am basically after finding out is how to keep a script constantly
>running on the server so that it can keep checking the dates. It only needs
>to do this once a day and what sort of problems that this could cause.

Use a crontab if you are on Unix. If you are on Windows, I have no clue
(upgrade to Unix?)

-- 
Rafael Garcia-Suarez


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

Date: Wed, 09 Aug 2000 10:13:11 GMT
From: mj.stevenson@auckland.ac.nz
Subject: Re: keeping a script alive.
Message-Id: <39912ee4.1302707354@news.chello.nl>

On Wed, 9 Aug 2000 10:36:21 +0100, "Neil Lathwood"
<laf@gameonline.co.uk> wrote:

>Hi Folks,
>
>I have to design a script that constantly checks a database for dates, when
>the current date matches the date in the database it will email a client
>some information.
>
>What I am basically after finding out is how to keep a script constantly
>running on the server so that it can keep checking the dates. It only needs
>to do this once a day and what sort of problems that this could cause.

It would be better to schedule the script to run once a day (cron
under unix).

If not possible wrap code in a while loop.

while(1){
   ### Your code here
   sleep(60*60*24); # sleep 24 hours
}

Matthew 


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

Date: Wed, 09 Aug 2000 10:22:08 GMT
From: marcel@codewerk.com (Marcel Grunauer)
Subject: Re: keeping a script alive.
Message-Id: <slrn8p2c5i.1p6.marcel@gandalf.local>

On Wed, 09 Aug 2000 10:13:11 GMT, mj.stevenson@auckland.ac.nz
<mj.stevenson@auckland.ac.nz> wrote:

>while(1){
>   ### Your code here
>   sleep(60*60*24); # sleep 24 hours
>}


Better check that one with your sysadmin before, though...


-- 
Marcel
sub AUTOLOAD{($_=$AUTOLOAD)=~s;^.*::;;;y;_; ;;print} Just_Another_Perl_Hacker();


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

Date: Wed, 9 Aug 2000 11:43:14 +0100
From: "Neil Lathwood" <laf@gameonline.co.uk>
Subject: Re: keeping a script alive.
Message-Id: <965817910.9899.0.nnrp-01.c246f129@news.demon.co.uk>

Thanks everyone......I will give all options some consideration before
settling with one.

Once again thanks for the replies.....less than an hour and I got four
replies ;-)

Neil

"Marcel Grunauer" <marcel@codewerk.com> wrote in message
news:slrn8p2c5i.1p6.marcel@gandalf.local...
> On Wed, 09 Aug 2000 10:13:11 GMT, mj.stevenson@auckland.ac.nz
> <mj.stevenson@auckland.ac.nz> wrote:
>
> >while(1){
> >   ### Your code here
> >   sleep(60*60*24); # sleep 24 hours
> >}
>
>
> Better check that one with your sysadmin before, though...
>
>
> --
> Marcel
> sub AUTOLOAD{($_=$AUTOLOAD)=~s;^.*::;;;y;_; ;;print}
Just_Another_Perl_Hacker();




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

Date: Wed, 9 Aug 2000 12:24:11 +0200
From: "Guenther Degenfelder" <guenther.degenfelder@datev.de>
Subject: Re: keeping a script alive.
Message-Id: <399130cd$1@news.datev.de>


"Neil Lathwood" <laf@gameonline.co.uk> schrieb im Newsbeitrag
news:965813893.8501.0.nnrp-01.c246f129@news.demon.co.uk...
> Hi Folks,
>
> I have to design a script that constantly checks a database for dates,
when
> the current date matches the date in the database it will email a client
> some information.
>
> What I am basically after finding out is how to keep a script constantly
> running on the server so that it can keep checking the dates. It only
needs
> to do this once a day and what sort of problems that this could cause.
>
> --
> Neil

Depends on:
What operating system your script is running on?!
Try to use 'crontab' or 'at' on unix or 'scheduler' or 'at' on winnt or
win2k.
Another OS independent way: use the TIVOLI scheduler    ;-)

Regards
    Guenther




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

Date: Wed, 9 Aug 2000 14:12:23 +0200
From: tony@svanstrom.com (Tony L. Svanstrom)
Subject: Re: keeping a script alive.
Message-Id: <1ef3okj.m89l2c8gu0w0N%tony@svanstrom.com>

Marcel Grunauer <marcel@codewerk.com> wrote:

> On Wed, 09 Aug 2000 10:13:11 GMT, mj.stevenson@auckland.ac.nz
> <mj.stevenson@auckland.ac.nz> wrote:
> 
> >while(1){
> >   ### Your code here
> >   sleep(60*60*24); # sleep 24 hours
> >}
> 
> 
> Better check that one with your sysadmin before, though...

Yup, that he better do, and since the "main" script might be the one
with a more complex problem in it (ie that it fails, and does that when
he's least likely to find out) he might consider runing a separate
script that keeps the main one up. If you don't mind a non-Perl one
(false laziness, this way I can just copy and paste :)

#!/bin/sh
while true ; do
        [what2do]
        sleep 86400
done


     /Tony
-- 
     /\___/\ Who would you like to read your messages today? /\___/\
     \_@ @_/  Protect your privacy:  <http://www.pgpi.com/>  \_@ @_/
 --oOO-(_)-OOo---------------------------------------------oOO-(_)-OOo--
 DSS: 0x9363F1DB, Fp: 6EA2 618F 6D21 91D3 2D82  78A6 647F F247 9363 F1DB
 ---ôôô---ôôô-----------------------------------------------ôôô---ôôô---
    \O/   \O/  ©1999  <http://www.svanstrom.com/?ref=news>  \O/   \O/


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

Date: Wed, 9 Aug 2000 14:36:56 +0200
From: "HD" <elbereth*nospam*@gmx.de>
Subject: lamer problem of commiting a perl script
Message-Id: <8mrjg7$6pp$1@news01.khis.de>

I am starting in perl a few days ago

#!/usr/bin/perl


if($ENV{'REQUEST_METHOD'} eq 'GET')
 {
  $Daten = $ENV{'QUERY_STRING'}
 }
else
 {
  read(STDIN, $Daten, $ENV{'CONTENT_LENGTH'});
 }

@Formularfelder = split(/&/, $Daten);
foreach $Feld (@Formularfelder)
 {
  ($name, $value) = split(/=/, $Feld);
  $value =~ tr/+/ /;
  $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
  $value =~ s/<!--(.|\n)*-->//g;
  $Formular[$i] = $name;
  $i = $i + 1;
  $Formular[$i] = $value;
  $i = $i + 1;
 }

print "Content-type: text/html\n\n";
print "<html>\n";
print "<head>\n";
print "<title>Danke!</title>\n";
print "</head>\n";
print "<body bgcolor=#FFFFFF text=#000000 link=#009900 vlink=006600
alink=#0000FF>\n";
print "<h1>Danke</h1>\n";
print "Wir freuen uns, da&szlig; Sie unser Formular ausgef&uuml;llt \n";
print "haben. Hier zur Kontrolle Ihre Angaben:<p>\n";

for($i=0;$i<=$max;$i=$i+2)
{ 
 print "<b>$Formular[$i]:</b> $Formular[$i+1]<br>\n";
}
print "<p><hr noshade size=1><p>";
print "<i>Ihr Name, <a href=\"mailto:IhrName\@Provider.xx\">IhrName\@Provider.xx</a></i>";
print "</body>\n";
print "</html>\n";


I checked the syntax of the script and everything went right. I uploaded this script called comments.pl (gave rights of 775 to it) to a linux redhat-server, checked the existens of #!/usr/bin/perl.
But after running the script I got only the script, what did I wrong? Do I have to compile it like a java.applet or so, please help I have to finish the project on friday this week!

Thanks in advance, if I ain´t posted it clear enough I will try to specify!

HD






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

Date: 9 Aug 2000 11:57:53 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: non-blocking TCP connect()?
Message-Id: <8mrh01$32v$1@lublin.zrz.tu-berlin.de>

Logan Shaw <logan@cs.utexas.edu> wrote in comp.lang.perl.misc:
>Hi.
>
>I've got a situation whether I'd like to connect() several TCP sockets
>to several remote systems, but I'd like the connect itself to be
>non-blocking so that I can continue processing if one of the systems is
>down or being slow.
>
>The first edition of "Unix Network Programming" by Stevens says I can
>do this by creating the socket, binding it, and setting it to
>non-blocking and *then* calling connect(), but I'd like to do this in
>Perl.
>
>The problem is that IO::Socket::INET seems to do everything (creation,
>binding, and connect) all at once when you call its new() method.
>
>So, does anyone know if this is possible with that module?  My guess is
>that I could use Socket.pm instead, but I'd rather not if I can avoid
>it.

A glance at the source shows that IO::Socket::new calls connect only
if a peer address is given to the call to new().  You should then
be able to set it to non-blocking and call connect yourself.

Anno


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

Date: Wed, 09 Aug 2000 02:41:36 -0700
From: Peter_Gadsby <peter_gadsbyNOpeSPAM@hfcbank.co.uk.invalid>
Subject: Oracle connectivity using Perl
Message-Id: <0aa09d08.4e0c28d8@usw-ex0102-014.remarq.com>

Hi all,

I'm connecting Perl to an Oracle database, and generating HTML.

The Oracle database is on an IBM RS 6000, running AIX ( UNIX ).

I'm using IE5 and the code seems to work fine, but users running
on IE4 the process seems to hang.

When I modify the script in question ( add a comment, or
whatever ) the script will then work in both ie4, and ie5.

I'm using the package Oraperl to connect to Oracle. I don't
understand why it would intermittently stop working....

Is Perl usually so flakey when connecting to an Oracle database,
this is my first time using Perl, and so far it doesn't inspire
me with confidence for using it on other projects.

Please help me resolve, this problem, because I really want to
use Perl further ......

Your help much appreciated

Peter_Gadsby@hfcbank.co.uk






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

Got questions?  Get answers over the phone at Keen.com.
Up to 100 minutes free!
http://www.keen.com



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

Date: Wed, 09 Aug 2000 08:43:37 +0100
From: Ian Stuart <ian.stuart@ed.ac.uk>
Subject: Re: password protected web pages which?
Message-Id: <39910BA9.CBF47B03@ed.ac.uk>

"." wrote:
> 
> plain text, database (MySQL), .htacces, etc.
> Which is the best? and How?
This is really a web-group discussion, not a Perl one, however.....

"Best" is subjective, thus is difficult to answer objectivly
(particularly if we can't see the objective :)

 .htaccess: + strong system, done at the server end and requires no code
to test for acceptable access
          - Requires sysadmin access to the box to add "users" (or
change their password)

plan text: + easy to impliment. QAD solution
           - easy to crack

database:  + harder to crack, better tracking, used by most people(? i
think..)
           - needs the most coding to get it to work

#and an alternative:
tied hash: +/- halfway between a DB and a plain text file.


-- 
           --==**==--
Ian Stuart - University computing services.
---------------------------------
Truth is what you believe it to be.
  I cannot force my facts on you, only make you believe my beliefs.
---------------------------------
http://lucas.ucs.ed.ac.uk/


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

Date: Wed, 9 Aug 2000 09:48:44 GMT
From: MJ Dainty <md7141@bris.ac.uk>
Subject: Perl 5.6.0 doesn't install on NetBSD/i386 1.4.2
Message-Id: <Pine.SOL.4.05.10008091041520.37-100000@sis.bris.ac.uk>

Hi,

I have a brand new NetBSD system that I have tried to install the latest
stable Perl dist. on. All goes fine building until I issue the "make
install", and then it falls over with the following error, <peers over
to the NetBSD box>:

Can't load 'lib/auto/File/Glob/Glob.so' for module File::Glob: No such
file or directory at lib/XSLoader.pm line 73.
at lib/File/Glob.pm line 94
Compilation failed in require at installperl line 66.
BEGIN failed--compilation aborted at installperl line 66.
*** Error code 255

Stop.

My config is the default options, bar one to install perl into /usr/bin
as well as /usr/local/bin.

"make test" failed on one thing, but a message appeared with it saying
this was typical on *BSD and some other systems.

The same tarball built fine on a Linux i686 box moments earlier...

Thanks

Matt



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

Date: Wed, 9 Aug 2000 03:16:32 -0400
From: "Jim_Kearman" <jkearmanNO@mindspring.com>
Subject: Perl and PWS Redux
Message-Id: <8mr0h0$o4b$1@slb0.atl.mindspring.net>

I have been using PWS4 to test ASP with no problems. Tonight I installed
ActiveState Perl in C:/Perl. PWS was running when I installed it. I selected
PerlScript when I installed it.

In HKLM/System/CurrentControlSet/Services/Parameters/ScriptMap I have:

 .cgi c:\perl\bin\perl.exe %s %s (someone suggested this in an earlier post;
I also tried "perlis.dll")

And the same for .pl and .plx.

When I place the HTML below in wwwroot, and try to run:
http://localhost/helloworld.htm I get no "hello world."

Why doesn't this run? I've also tried running a .pl installed in cgi-bin via
an HTML page in root, and I get the HTTP 500 error (problem with page, as if
it's trying to load the .pl instead of running it). I have cgi-bin
permissions clicked at Read, Execute and Scripts. I've rebooted after
editing the Registry and permissions.

Why doesn't Perl run? Thanks.

<%@ LANGUAGE = PerlScript %>
<HTML>
<HEAD>
<TITLE>PerlScript Hello World!</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF">

<%
>$Response->write("Hello world!");
>%>
</BODY>
</HTML>








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

Date: Wed, 09 Aug 2000 12:02:48 GMT
From: vagabond_nomad@my-deja.com
Subject: Perl External Program Question
Message-Id: <8mrh98$hgq$1@nnrp1.deja.com>

I am very, very, very new to CGI / Pearl, so I apologize in advance for
my vast ignorance on this subject.  My task is to find a way interface a
CGI program with a DOS program sitting on a UNIX server.  Here are the
specifics:

From a web browser, a user will start up a DOS program sitting on a UNIX
server.  The DOS program will send output to the user's web browser that
will be displayed as HTML.  The user will then enter some input into the
web browser, which will then be sent back to the DOS program for
processing.  Next the DOS program will send output, based on the user's
last input, back to the user's web browser.  And so on.

Is this possible?  If so, can someone help me understand how to do this?
 Code examples would be greatly appreciated since I don't really
understand much about Pearl yet.  Again, I'd be tremendously thankful if
someone could help solve this problem, or perhaps point me to a site
where I might be able to get some help.

-Brent


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Wed, 09 Aug 2000 08:18:30 GMT
From: jason <elephant@squirrelgroup.com>
Subject: Re: perl job newsgroup
Message-Id: <MPG.13fbb13ea27b1f019896d3@news>

cardwellm@my-deja.com writes ..
>I need a perl script done by a programmer, in what newsgroup would it be
>appropriate to post my offer?

one of the jobs newsgroups .. they're split up by region

-- 
  jason -- elephant@squirrelgroup.com --


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

Date: Wed, 09 Aug 2000 12:00:16 GMT
From: vagabond_nomad@my-deja.com
Subject: Perl/CGI External Program Question
Message-Id: <8mrh4g$hgf$1@nnrp1.deja.com>

I am very, very, very new to CGI / Pearl, so I apologize in advance for
my vast ignorance on this subject.  My task is to find a way interface a
CGI program with a DOS program sitting on a UNIX server.  Here are the
specifics:

From a web browser, a user will start up a DOS program sitting on a UNIX
server.  The DOS program will send output to the user's web browser that
will be displayed as HTML.  The user will then enter some input into the
web browser, which will then be sent back to the DOS program for
processing.  Next the DOS program will send output, based on the user's
last input, back to the user's web browser.  And so on.

Is this possible?  If so, can someone help me understand how to do this?
 Code examples would be greatly appreciated since I don't really
understand much about Pearl yet.  Again, I'd be tremendously thankful if
someone could help solve this problem, or perhaps point me to a site
where I might be able to get some help.

-Brent


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Wed, 9 Aug 2000 12:14:53 +0200
From: "Guenther Degenfelder" <guenther.degenfelder@datev.de>
Subject: Re: Problem with Net::Telnet
Message-Id: <39912ea0$1@news.datev.de>


<jpalloz@my-deja.com> schrieb im Newsbeitrag
news:8mq02o$iuv$1@nnrp1.deja.com...
> I need to use Net::Telnet to telnet into a propeitary database
> interface, similiar to sqlplus.
>
> The idea is to telnet into this database from an outside perl/cgi,
> and then either create new records or update existing ones.
>
> The problem is this particular interface has no prompt. The cursor
> simply blinks at the beginning of the line waiting for you to issue
> your commands.

The login-method is waiting for the prompts 'user:' and 'password:' (or
seomething else?!) and then prints the UserID and Password. This is done
with
    $t->waitfor('/user:/');
    $t->print($UserID);
    $t->waitfor('/password:/');
    $t->print($Password);

If you have problems with YOUR shape of prompts, you have to another
    $t->waitfor('/something else/');
    $t->print($UserID);
    ...

But be careful:
Don't send your $Password to unknown prompts!    ;-)

    Guenther




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

Date: Wed, 09 Aug 2000 10:16:51 GMT
From: bolero92@my-deja.com
Subject: setuid root perl script
Message-Id: <8mrb2h$dt8$1@nnrp1.deja.com>

I am writing a CGI script to change user e-mail forwarding configuration
which will copy /etc/mail/aliases.save to /etc/mail/aliases
and run "/usr/bin/newaliases"

but the script can't run successfully and the error log shows:
Insecure $ENV{PATH} while running setuid at /dev/fd/3 line 61, <FILE2>
chunk 133.

Why?


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Wed, 09 Aug 2000 12:39:34 GMT
From: rgarciasuarez@free.fr (Rafael Garcia-Suarez)
Subject: Re: setuid root perl script
Message-Id: <slrn8p2ki2.koe.rgarciasuarez@rafael.kazibao.net>

bolero92@my-deja.com wrote in comp.lang.perl.misc:
>I am writing a CGI script to change user e-mail forwarding configuration
>which will copy /etc/mail/aliases.save to /etc/mail/aliases
>and run "/usr/bin/newaliases"
>
>but the script can't run successfully and the error log shows:
>Insecure $ENV{PATH} while running setuid at /dev/fd/3 line 61, <FILE2>
>chunk 133.

When you encounter an error message you don't understand, the simplest
is often to look it up in the perldiag manpage.

-- 
Rafael Garcia-Suarez


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

Date: 9 Aug 2000 12:43:42 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: setuid root perl script
Message-Id: <8mrjlu$378$1@lublin.zrz.tu-berlin.de>

 <bolero92@my-deja.com> wrote in comp.lang.perl.misc:
>I am writing a CGI script to change user e-mail forwarding configuration
>which will copy /etc/mail/aliases.save to /etc/mail/aliases
>and run "/usr/bin/newaliases"
>
>but the script can't run successfully and the error log shows:
>Insecure $ENV{PATH} while running setuid at /dev/fd/3 line 61, <FILE2>
>chunk 133.
>
>Why?

Whenever an error message (or warning) from Perl isn't clear, it's
a good idea to run it through the diagnostics module.  This will
give you a wordier explanation of what happened, often pointing you
to additional material to read.

This can be done in two ways:  Either insert "use diagnostics"
near the beginning of your program, or , after the fact, feed the
error message to the splain program via stdin.

In this particular case,

echo 'Insecure $ENV{PATH} while running setuid' | splain

yields

    (F) You can't use system(), exec(), or a piped open in a setuid or
    setgid script if any of $ENV{PATH}, $ENV{IFS}, $ENV{CDPATH},
    $ENV{ENV} or $ENV{BASH_ENV} are derived from data supplied (or
    potentially supplied) by the user.  The script must set the path to a
    known value, using trustworthy data.  See perlsec.

Take it from there.

Anno


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

Date: 9 Aug 2000 07:27:44 GMT
From: mahesha@nital.stpp.soft.net
Subject: sh: lst2: Generated or received a file descriptor number that is not valid
Message-Id: <8mr15g$jdh$1@news.netmar.com>

Hi,

I have a couple of small perl scripts...

One is exec.pl ...

#!/usr/local/bin/perl -w

my $CmdStr1 = "my.pl > lst1";
my $CmdStr2 = "my.pl >& lst2";

system ("$CmdStr1");
system ("$CmdStr2");

 .. and other my.pl ...

#!/usr/local/bin/perl -w

print "An STDOUT String1\n";
print STDERR "An STDERR String2\n";
print "An STDOUT String3\n";
print STDERR "An STDERR String4\n";

Upon executing exec.pl, these are the responses that I get on two
versions of perl (on two different OSs).

On perl version 5.005_03 built for i386-linux, (Exactly the way I want)

An STDERR String2
An STDERR String4

(Lst1 has only the STDOUT messages & Lst2 has both STDERR & STDOUT
messages)

And on perl v5.6.0 built for 9000/777-hpux, (Error. Functionality, not
as desired)

An STDERR String2
An STDERR String4
sh: lst2: Generated or received a file descriptor number that is not
valid.

(Lst1 has only the STDOUT messages. Script exits before generating Lst2
due to an error)
------------------------------------------------------------------------

I think the problem lies in the '&' in $CmdStr2. If that is removed,
all's well - except the functionality - because I want all the STDERR
& STDOUT messages to go into the lst files. Is there any way I can get
response on v5.6.0 similar to the 5.005_03?

I have an idea that perl 5.6.0 treats file descriptors differently as
compared to its predecessors - as real variables. But I am not sure if
this problem is related to that fact.

- Mahesh

     -----  Posted via NewsOne.Net: Free Usenet News via the Web  -----
     -----  http://newsone.net/ --  Discussions on every subject. -----
   NewsOne.Net prohibits users from posting spam.  If this or other posts
made through NewsOne.Net violate posting guidelines, email abuse@newsone.net


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

Date: 9 Aug 2000 07:24:59 GMT
From: mahesha@nital.stpp.soft.net
Subject: sh: lst2: Generated or received a file descriptor number that is not valid
Message-Id: <8mr10b$j7a$1@news.netmar.com>

Hi,

I have a couple of small perl scripts...

One is exec.pl ...

#!/usr/local/bin/perl -w

my $CmdStr1 = "my.pl > lst1";
my $CmdStr2 = "my.pl >& lst2";

system ("$CmdStr1");
system ("$CmdStr2");

 .. and other my.pl ...

#!/usr/local/bin/perl -w

print "An STDOUT String1\n";
print STDERR "An STDERR String2\n";
print "An STDOUT String3\n";
print STDERR "An STDERR String4\n";

Upon executing exec.pl, these are the responses that I get on two
versions of perl (on two different OSs).

On perl version 5.005_03 built for i386-linux, (Exactly the way I want)

An STDERR String2
An STDERR String4

(Lst1 has only the STDOUT messages & Lst2 has both STDERR & STDOUT
messages)

And on perl v5.6.0 built for 9000/777-hpux, (Error. Functionality, not
as desired)

An STDERR String2
An STDERR String4
sh: lst2: Generated or received a file descriptor number that is not
valid.

(Lst1 has only the STDOUT messages. Script exits before generating Lst2
due to an error)
------------------------------------------------------------------------

I think the problem lies in the '&' in $CmdStr2. If that is removed,
all's well - except the functionality - because I want all the STDERR
& STDOUT messages to go into the lst files. Is there any way I can get
response on v5.6.0 similar to the 5.005_03?

I have an idea that perl 5.6.0 treats file descriptors differently as
compared to its predecessors - as real variables. But I am not sure if
this problem is related to that fact.

- Mahesh



     -----  Posted via NewsOne.Net: Free Usenet News via the Web  -----
     -----  http://newsone.net/ --  Discussions on every subject. -----
   NewsOne.Net prohibits users from posting spam.  If this or other posts
made through NewsOne.Net violate posting guidelines, email abuse@newsone.net


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

Date: 9 Aug 2000 12:06:14 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: sh: lst2: Generated or received a file descriptor number that is not valid
Message-Id: <8mrhfm$355$1@lublin.zrz.tu-berlin.de>

Mahesh Asolkar  <mahesha@nital.stpp.soft.net> wrote in comp.lang.perl.misc:
>Hi,
>
>I have a couple of small perl scripts...
>
>One is exec.pl ...
>
>#!/usr/local/bin/perl -w
>
>my $CmdStr1 = "my.pl > lst1";
>my $CmdStr2 = "my.pl >& lst2";

Perl uses sh to interpret a system call with shell metacharacters in it.
"my.pl >& lst2" isn't valid sh syntax.  Try "my.pl > lst2 2>&1" instead.

Anno


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

Date: Wed, 09 Aug 2000 09:13:50 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Simple reg expression question
Message-Id: <0582ps8lhoc26j0ma9mpttuug4vgcadtb4@4ax.com>

Kenny Lim wrote:

>(b) The total given value to be incremented exceeded 9.
>(ie. $2 = 9, current value is ETProj99, the outcome result would be 918
>where it should be 108)

Eh? So you jump from version 9.9 to 10.8?

-- 
	Bart.


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

Date: Wed, 09 Aug 2000 11:48:16 GMT
From: guddat@gmx.de
Subject: Re: Tk module for Windows NT
Message-Id: <8mrge0$h3c$1@nnrp1.deja.com>

In article <8mqhlf$ttf$1@nnrp1.deja.com>,
  dcumro@my-deja.com wrote:
> In article <OZhj5.80$DT4.2755694@nnrp2.clara.net>,
>   newsgroups@ckeith.clara.net (Colin Keith) wrote:
> > In article <8mg8hr$3or$0@216.39.131.175>,
> homer.simpson@springfield.nul (Homer Simpson) wrote:
> > >junk after document element at line 1, column 63, byte 63 at
> > >C:/Perl/site/lib/XML/Parser.pm line 168
> > >C:\>
> >
> > Hmmm, looks like the XML page you're getting is broken.
> > Try getting it from a different site?
> >
> > set repository NAME URL
> >
> > Otherwise if PPM still doesn't work, the activestate docs say you
can
> get it
> > from them in zip format:
> >
> > http://www.activestate.com/packages/zips
> >
> > hope it helps.
> >
> > Col.
> >
> >  Damn, my bug's wandered off. I think its trying to steal my coke
> bottle :p
> >
> > ---
> > Colin Keith
> > Systems Administrator
> > Network Operations Team
> > ClaraNET (UK) Ltd. NOC
> >
> Hi
> I also got the error message "just after document element ..." from
PPM
> when trying to install libnet.  I noticed that the activestate website
> changed its directories.  What used to be
www.activestate.com/packages/
> is now www.activestate.com/PPMPakages/5.005/.  First I tried just
"PPM>
> set repository activestate
> http://www.activestate.com/PPMPackages/5.005/".  That didn't solve my
> problem.  I then looked at ppm.xml and noted that it had a lot of
> references to www.activestate.com/packages.  So I made a backup copy
of
> ppm.xml and then did a global change of "/packages/"
> to "/PPMPackages/5.005/" and I was able to install libnet just fine.
> Be sure to make a backup copy of ppm.xml.
>
> Dennis L. Cumro
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>
I've got the same problem:
     junk after document element at line 1, column 69, byte 69 at
     F:\LANGUAGE\PERL\site\lib/XML/Parser.pm line 153

I also renamed the directories as described below. But now:
     Install package 'MD5?' (y/N): y
     Out of memory!
     Out of memory!
     Error: Runtime exception

Can anybody help ???

Thanks,
Bastian Guddat/ germany


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Wed, 09 Aug 2000 13:56:11 +0200
From: Ulrich Ackermann <uackermann@orga.com>
Subject: Using Bit::Vector for large hex-number arithmetic
Message-Id: <399146DB.EB779E22@orga.com>

Hi,
I am trying to calculate things like (64 Byte hex)**(64 Byte hex) and
thought, that Bit::Vector might be the right choice for that.
But after reading the documentation and trying a bit I am really stuck
with it.

What I was trying looks like this:

1	#!/usr/local/bin/perl -w
2	
3	use strict; 
4	use Bit::Vector;
5
6	Bit::Vector->Configuration("input = hexadecimal");
7
8
9	my $vector1 = Bit::Vector->new(512);
10	$vector1 = "88888888888888888888";
11	$vector1 **= "15";
12	print "vector1 = $vector1\n";

If I try a number, bigger than that in line 10, I will get "vector1 =
inf", independently from the number of bits I giving the new()-method.
And if I use an "F" instead of the "15" in line 11 it gives me an error
(Argument "F" isn't numeric in exponentiation) although I have the
Configuration-Statement in line 6.
I think, I am *really* missing something, but I cannot work out what it
is.

Any help appriciated,

Ulrich
-- 
Ulrich Ackermann
ORGA Kartensysteme GmbH (SY-PEAT-STA)
Tel.:+49.5254.991-925 
mailto:uackermann@orga.com


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

Date: 9 Aug 2000 13:03:02 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Using Bit::Vector for large hex-number arithmetic
Message-Id: <8mrkq6$39q$1@lublin.zrz.tu-berlin.de>

[Crossposting to comp.lang.perl.modules removed]

Ulrich Ackermann  <uackermann@orga.com> wrote in comp.lang.perl.misc:
>Hi,
>I am trying to calculate things like (64 Byte hex)**(64 Byte hex) and
>thought, that Bit::Vector might be the right choice for that.
>But after reading the documentation and trying a bit I am really stuck
>with it.
>
>What I was trying looks like this:
>
>1	#!/usr/local/bin/perl -w
>2	
>3	use strict; 
>4	use Bit::Vector;
>5
>6	Bit::Vector->Configuration("input = hexadecimal");
>7
>8
>9	my $vector1 = Bit::Vector->new(512);
>10	$vector1 = "88888888888888888888";

You have just overwritten the newly created Bit::Vector with an
ordinary Perl scalar.

>11	$vector1 **= "15";

This, too, is not an operation that would be understood by Bit::Vector[1],
even if $vector still were such an object.

>12	print "vector1 = $vector1\n";
>
>If I try a number, bigger than that in line 10, I will get "vector1 =
>inf", independently from the number of bits I giving the new()-method.
>And if I use an "F" instead of the "15" in line 11 it gives me an error
>(Argument "F" isn't numeric in exponentiation) although I have the
>Configuration-Statement in line 6.
>I think, I am *really* missing something, but I cannot work out what it
>is.

See perldoc Bit::Vector (yes, it's a big doc) on how to set a vector
to a desired value and how to do long arithmetic with them.

Anno

[1] Well, not without some help from overload.  I don't think Bit::Vector
    does that by default.


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

Date: Wed, 09 Aug 2000 13:54:56 +0200
From: Abe Timmerman <abe@ztreet.demon.nl>
Subject: Re: What to do with 1A(hex) in a file?
Message-Id: <dkg2psgev4pn7caoihlsiaruef6k789v30@4ax.com>

On Tue, 08 Aug 2000 22:22:33 +0200, Hartmut Wind
<hartmut.wind@t-online.de> wrote:

> I get a file from another computer (via ftp in ASCII mode). A perl
> script running through all of the
> 43200 lines to pick up some parts. Sometimes,  it happens that only the
> first part is processed,
> caused by an character, which is 1A(hex). perl assumes that the file is
> at the end (remaining
> appr. 8000 lines got ignored).
> Note: I use 'binmode(IN)' for the input stream, so that 0A(hex), 0D(hex)
> is not modified
> (Windows Environment)

It looks like your binmode() is broken then, but I don't think it is.
It's hard to tell what's wrong without _any_ code or error message.
Could you show us a small example that shows this behavior?


-- 
Good luck,
Abe


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

Date: Wed, 09 Aug 2000 12:30:27 GMT
From: Jim Mauldin <mauldin@netstorm.net>
Subject: Re: When does it pay to presize an array?
Message-Id: <39914E4F.5EDC58DC@netstorm.net>

"Andrew J. Perrin" wrote:
> 
> 
>                                                             I would still
> love to see some code that demonstrates the utility of presizing an array!
> 

I doubt if you ever will.  The only way to implement an @array structure
that can contain any data type is with pointers, and I *believe* that
the underlying structure of an @array is an array of pointers (as
opposed to a linked list) with a reference counter (like a stack
pointer).  To extend an array beyond the initial "wiggle room", you
would copy the pointers into a new, larger array and possibly allocate
another block of memory.  Doing a mass copy is very efficient (a
fundamental opcode), and the data itself doesn't move. 

Also, re indexing:  there is clearly a lot of overhead associated with
indexing into an array, and I've discovered that if I have to use a
particular array element repeatedly it's better to assign it to a scalar
and use that instead.

IMHO

-- Jim


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

Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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.  

| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

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.

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 V9 Issue 3961
**************************************


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