[10583] in Perl-Users-Digest
Perl-Users Digest, Issue: 4175 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Nov 8 01:07:26 1998
Date: Sat, 7 Nov 98 22:00:18 -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, 7 Nov 1998 Volume: 8 Number: 4175
Today's topics:
--->Perl Support WANTED<----- <cmt3@att.net>
Re: a small question <r28629@email.sps.mot.com>
Re: a small question <jeffp@crusoe.net>
Re: a small question (Matthew Bafford)
Re: Compilation error in /cgi-bin/feedback.cgi <jbharvey@auspex.net>
Re: Compilation error in /cgi-bin/feedback.cgi cyrnos@my-dejanews.com
Re: Compilation error in /cgi-bin/feedback.cgi cyrnos@my-dejanews.com
DBI Module Needed <akapaco@idfw.com>
Re: History of Perl <jbharvey@auspex.net>
Re: I thought unbound variables were guaranteed to be z <rootbeer@teleport.com>
Making a Counter <Pap22@erols.com>
Re: Not to start a language war but.. (Clemens Hintze)
Re: opendir() VS glob - WAS Re: readdir bug in win95 pe (Ronald J Kimball)
perl program wanted <bbilling@sno.net>
Re: Perl Warning Message? (Ronald J Kimball)
Re: Perl Warning Message? (Tad McClellan)
Re: Perl Warning Message? (Abdul Ali)
Perl5 Win32::ODBC SQL Statement Involing dates <strat@centralnet.net>
Re: PLEASE HELP! <r_larsen@image.dk>
seriel or ttyS0 <drobick@arco.met.fu-berlin.de>
start a program with exec(); <euhost@euhost.com>
Re: start a program with exec(); <rootbeer@teleport.com>
trouble with grep.... <damonbrent@earthlink.net>
Re: trouble with grep.... Lee.Lindley@bigfoot.com
Re: VARIABLES DE ENTORNO CGI (Nicolas Rodrmguez)
Re: Which is the better choice? mod_perl, fastcgi, embp hup@my-dejanews.com
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 7 Nov 1998 21:23:35 GMT
From: "Mike Thacker" <cmt3@att.net>
Subject: --->Perl Support WANTED<-----
Message-Id: <722don$igv@bgtnsc03.worldnet.att.net>
Our company needs support for our existing web site perl code.
Email or call.
Mike Thacker, IT Manager
BFC Enterprises, Inc. mike@NetCollect.com
***********************************************
615-859-5236 ext. 210
800-826-4929 ext. 210
------------------------------
Date: Sat, 07 Nov 1998 14:45:49 -0500
From: Tk Soh <r28629@email.sps.mot.com>
Subject: Re: a small question
Message-Id: <3644A35D.12C7F027@email.sps.mot.com>
Tom Phoenix wrote:
>
> On Sat, 7 Nov 1998, Tk Soh wrote:
>
> > print 'is an integer' if $var =~/^\d+$/;
>
> Isn't -3 still an integer? :-)
>
Oops. Thanks for catching this. I should have said 'unsigned' integer ;-)
-tk
------------------------------
Date: Sat, 7 Nov 1998 17:43:01 -0500
From: Jeff Pinyan <jeffp@crusoe.net>
Subject: Re: a small question
Message-Id: <Pine.GSO.3.96.981107174221.28550A-100000@crusoe.crusoe.net>
On Sat, 7 Nov 1998, Tk Soh wrote:
> Tom Phoenix wrote:
> >
> > On Sat, 7 Nov 1998, Tk Soh wrote:
> >
> > > print 'is an integer' if $var =~/^\d+$/;
> >
> > Isn't -3 still an integer? :-)
> >
>
> Oops. Thanks for catching this. I should have said 'unsigned' integer ;-)
Signed or unsigned, C<print 'integer' if $num == int $num;> works too,
without wasting a regex.
--
Jeff Pinyan (jeffp@crusoe.net)
www.crusoe.net/~jeffp
Crusoe Communications, Inc.
973-882-1022
www.crusoe.net
------------------------------
Date: Sat, 7 Nov 1998 19:22:16 -0500
From: dragons@scescape.net (Matthew Bafford)
Subject: Re: a small question
Message-Id: <MPG.10aeae44f44ad0f5989704@news.scescape.net>
In article <<Pine.GSO.4.02A.9811070931151.21718-
100000@user2.teleport.com>>, rootbeer@teleport.com (Tom Phoenix)
pounded the following:
=> On Sat, 7 Nov 1998, #YE XIANGZHOU# wrote:
=>
=> > How to tell whether a number or string is stored in a scalar variable?
=>
=> See the FAQ. Hope this helps!
[Not directed to TomP specifically]
Out of curiosity, is there anything wrong with something like this:
#!/usr/bin/perl -w
use strict;
sub isanumber {
my $isanumber = 1;
{
local $SIG{__WARN__} = sub { $isanumber = 0; };
1 if $_[0] + 0;
}
$isanumber;
}
foreach ( @ARGV ) {
if ( isanumber($_) ) {
print "$_ is a number!\n";
}
else {
print "$_ is not a number.\n";
}
}
__END__
I'd think it'd be slightly better than using a regex, especially since
it accepts any of Perl's idea of number.
Of course, TMTOWTDI...
Thanks,
--Matthew
------------------------------
Date: Sat, 07 Nov 1998 22:52:48 GMT
From: "Justin B. Harvey" <jbharvey@auspex.net>
Subject: Re: Compilation error in /cgi-bin/feedback.cgi
Message-Id: <3644CF43.2E20DC2A@auspex.net>
Permission of the beast? :>
j
Tom Phoenix wrote:
> But first, learn enough about Unix to know why you don't usually want the
> permissions of a directory set to 666.
------------------------------
Date: Sun, 08 Nov 1998 01:59:09 GMT
From: cyrnos@my-dejanews.com
Subject: Re: Compilation error in /cgi-bin/feedback.cgi
Message-Id: <722ttd$6fr$1@nnrp1.dejanews.com>
Hi imchat@ionet.net, Where can i read more about "the set up of the log
files"? This is my first try, and i see a log folder in the same directory as
my cgi-bin but which log file should i set permission to 666? There are
scripts already running into this folder so what does the log files has to do
with the script? Does each script has it's own log files? If not, since the
others scripts are running shouldn't it be the same set up for mine? Thanks
for your time, Olivier
In article <364453a5.61445864@news.ionet.net>,
imchat@ionet.net wrote:
> Make sure your logfile is in the right directory with permission set
> to 666.
>
> On Sat, 07 Nov 1998 05:00:53 GMT, cyrnos@my-dejanews.com wrote:
>
> >My perl script was created and run free of error with "Perl Builder".
> >Since it's my first i guess i missed something on the server side even though
> >the permission are set to: r w x r - x r - x and i uploaded using
> >ASCII format. Can somebody help?
> >I try with 2 different servers/cgi-bin directories and in the first one i get
> >this error message:
> >
> >Compilation error in /cgi-bin/feedback.cgi
> >
> >failed to open log file
> >fopen: Permission denied
> >
> >On the other server i get this messages:
> >Compilation error in /cgi-bin/feedback.cgi
> >Thx
> >
> >-----------== Posted via Deja News, The Discussion Network ==----------
> >http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
>
>
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Sun, 08 Nov 1998 02:03:19 GMT
From: cyrnos@my-dejanews.com
Subject: Re: Compilation error in /cgi-bin/feedback.cgi
Message-Id: <722u57$6jh$1@nnrp1.dejanews.com>
Hi Tom, Where can i read more about "the set up of the log files"? This is my
first try, and i see a log folder in the same directory as my cgi-bin but
which log files should i set permission to 666? There are scripts already
running into this folder so what does the log files has to do with the
script? Does each script has it's own log files? If not, since the others
scripts are running shouldn't it be the same set up for mine? Thanks for your
time, Olivier
In article <Pine.GSO.4.02A.9811070928150.21718-100000@user2.teleport.com>,
Tom Phoenix <rootbeer@teleport.com> wrote:
> On Sat, 7 Nov 1998 imchat@ionet.net wrote:
>
> > Make sure your logfile is in the right directory with permission set
> > to 666.
>
> But first, learn enough about Unix to know why you don't usually want the
> permissions of a directory set to 666.
>
> If you have further questions about Unix and file permissions, the docs,
> FAQs, and newsgroups about Unix should be helpful. Cheers!
>
> --
> Tom Phoenix Perl Training and Hacking Esperanto
> Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
>
>
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Sat, 7 Nov 1998 18:38:37 -0600
From: "Paco" <akapaco@idfw.com>
Subject: DBI Module Needed
Message-Id: <08B0BF3F89113132.2C13D933755C9EDA.7288EE0AD88F9235@library-proxy.airnews.net>
I am running PostgreSQL on a FreeBSD system and need
to get ahold of the DBI module for Perl. All the sites I have
tried to download from today have failed saying the files
are not available. Can anyone steer me to a reliable source
for the DBI modules for PostgreSQL. Thanks.
------------------------------
Date: Sat, 07 Nov 1998 22:45:49 GMT
From: "Justin B. Harvey" <jbharvey@auspex.net>
Subject: Re: History of Perl
Message-Id: <3644CDA0.F7DEE089@auspex.net>
Try
http://www.perl.com/CPAN-local/doc/manual/html/pod/perlhist.html
j
Jonathan Bartlett wrote:
>
> Does anyone know a site I can visit that has the history of the Perl
> programming lnaguage?
>
> Jonathan Bartlett
------------------------------
Date: Sat, 07 Nov 1998 21:13:26 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: I thought unbound variables were guaranteed to be zero
Message-Id: <Pine.GSO.4.02A.9811071311310.21718-100000@user2.teleport.com>
On 7 Nov 1998, tbrannon wrote:
> $cluster{amount}{min}=0;
So, $cluster{amount} is a reference to a hash.
> $cluster{amount}{max}=$total_synapses/$cluster{amount};
But here on the right you're using it as a number? If you ask Perl to do
something weird, don't be too surprised when it does something weird. :-)
Also, consider 'use strict', so that you won't be using a symbolic
reference by accident. Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Sat, 7 Nov 1998 19:42:30 -0500
From: "Pap" <Pap22@erols.com>
Subject: Making a Counter
Message-Id: <722ue2$gol$1@autumn.news.rcn.net>
I've tried some things I've seen in previous posts but have had no luck.
What I'm trying to do is simply number my rows when they get sorted in the
script.
In my script is:
------------------
$counter = 0;
print map "<td>$counter.</td><td><a href=\"profile.cgi?$_->[4]\">$_->[5]
$_->[0]</a></td><td>$_->[3]%</td></tr>\n",
sort { $b->[3] <=> $a->[3] } map {
chomp;
$counter = $counter+1;
------------------
But I'm sure you can see is that the value of $counter will be the FINAL
total of lines of data it went through (in this case about 34) and will just
display "34." throughout the board. I was able to assign $counter to the
array where you see [0], [3], [4], ect., and using [6] for it, but it just
maps [6] together with [0] (and [0] is supposed to be sorted decending), so
I just get [6] in no helpful order.
How can I solve this?
------------------------------
Date: Sun, 8 Nov 1998 00:08:34 GMT
From: cle@qiao.in-berlin.de (Clemens Hintze)
Subject: Re: Not to start a language war but..
Message-Id: <slrn749o81.t8m.cle@qiao.in-berlin.de>
In article <910414036.641270@thrush.omix.com>, Zenin wrote:
...
>
> And to any 5 day old Perl programmer, an 'eval{block}; if ($@){}'
> statement is equally as reflective.
>
> If the "Purer OO" languages could agree on any of this (Python has
> except: while Java has catch, etc) I might give you more points
> here. But they don't, so I can't.
>
...
I have a question. Given that there is a tarmodule for Perl which also wants to
raise exceptions on error, how would you program the following in Perl please?
import tarlib
try:
try:
tp = tarlib.TAR("~/myconfig.tar")
tp.add_file("~/.bashrc")
tp.add_file("~/.profile")
tp.add_file("~/.tcshrc")
except IOError, detail:
print "IOError occured during handling of tarfile: %s" % detail[1]
sys.exit(1)
except tarlib.FormatError:
print "File is not a tarfile"
sys.exit(2)
except tarlib.AddError, detail:
print "Could not add %s to archive, as: %s" % (detail.file, tp.file)
sys.exit(3)
except:
print "Unknown error raised!"
sys.exit(99)
else:
print "All files added" # Only be executed if no exception
finally:
tp.close() # Close the tarfile, regardless what4s happened
I mean that question serious! You4ve said, that Perl does not need
exceptions. But I cannot guess, how to do it in Perl without exceptions. I
did not write that to show Python is better than Perl or vice versa. I
have used Perl4 for years. Than Perl5 (not very long), now Python.
But I have only used "die", never Perl54s warn, croak, barf or whatever ;-)
Although I will not use Perl very often in future, I nevertheless not want to
loose the contact with it. So please be so kind to show me thy Perl's way to
go for such kind of problem.
Thanks in advance,
Cle.
------------------------------
Date: Sat, 7 Nov 1998 16:08:24 -0500
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: opendir() VS glob - WAS Re: readdir bug in win95 perl 5.00402?
Message-Id: <1di4ss6.14ht73618rcorkN@bay1-150.quincy.ziplink.net>
Tom Phoenix <rootbeer@teleport.com> wrote:
> On Sat, 7 Nov 1998, Ronald J Kimball wrote:
>
> > opendir()/etc. allows you to store one file at a time, while glob()
> > always means having a list of fiels.
>
> Naw, you can use glob() in a scalar context.
Oops... Well, I thought of one advantage of opendir() over glob(), at
least. :-)
--
_ / ' _ / - 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."
------------------------------
Date: Sat, 07 Nov 1998 16:04:38 -0800
From: "J.Billingsley" <bbilling@sno.net>
Subject: perl program wanted
Message-Id: <3644E016.5883@sno.net>
Hi there,
I am setting up a non-profit spinal cord injury resource on the web with
many cgi scripts already in place, however, there is one script which i
need to be customized for the site. I want to set up a simple database
of members listed in a nice tabled layout. For instance, a new row for
each member, and in each row a column for their 'name - linked to their
e-mail address', 'website', 'level of injury', 'gender', and 'age'.
Seems simple enough to me yet i can only customize pre-written scripts
as i haven't taken any perl lessons in writing them from scratch. I
can't offer much money as i am doing this large site for free but i can
offer you free advertising for an agreed hit rate/time limit etc. The
site is found at http://www.wheelweb.com (but it is my old personal site
for now until i get this one script completed)
I have approched other companies with the same request and whoever
offers their service will be rewarded - the best way i know how -
gratitude and free advertising.
Thanks for considering
Jason Billingsley
Wheelweb.com Administration
--
************************************
* Visit: http://www.wheelweb.com *
* The Spinal Cord Injury Resource *
************************************
------------------------------
Date: Sat, 7 Nov 1998 16:08:22 -0500
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: Perl Warning Message?
Message-Id: <1di4shm.17or4c41s2j5dsN@bay1-150.quincy.ziplink.net>
Abdul Ali <aali@ix.netcom.com> wrote:
> [...problem with join /["]/, @FIELDS...]
> This is working as designed accept I don't know why the warning
> message appears. Are you saying that I need to initialize the special
> variable $_ to get rid of the warning? Would that cause problems?
That would be one way to get rid of the warning... It certainly
wouldn't do what you intend, though.
Unlike split, the first argument to join is a *string*, not a regular
expression.
Consider:
join /["]/, @FIELDS;
# apply the regex /["]/ to the value of $_
# join @FIELDS together with the result
# (the result will be 1 if the regex matches, '' if not)
join '"', @FIELDS;
# join @FIELDS together with the double-quote character
Just so you know, you don't actually need to put double-quotes inside a
character class in a regex. These do the same thing:
/["]/
/"/
--
_ / ' _ / - 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."
------------------------------
Date: Sat, 7 Nov 1998 16:07:40 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Perl Warning Message?
Message-Id: <cbg227.bde.ln@flash.net>
Abdul Ali (aali@ix.netcom.com) wrote:
: On Sat, 7 Nov 1998 10:06:10 -0600, tadmc@flash.net (Tad McClellan)
: wrote:
: >Abdul Ali (aali@ix.netcom.com) wrote:
: >
: >: I'm getting the following Perl warning message: "Use of initialized
: >: value at fix_it line xx". The "xx" line is:
: >: $curr = join(/["]/, @FIELDS);.
: > ^^^^^
: >
: > this is equivalent to:
: >
: > $_ =~ /["]/
: >
: > have you put a value into the $_ special variable?
: >
: >
: > It is pretty strange to use a pattern match as your join()
: > expression though. I have no idea what you might really want
: > here.
: >
: > Do you want to put a double quote between each array element?
: >
: > Or a double quote inside of square brackets?
: >
: > Or double quotes _surrounding_ each element?
: >
: > ???
: Tad
: No, I did not put a value into $_.
That is the uninitialized value then. You are trying to match
against a string that has not been set to anything.
So it cannot possibly match.
So the /["]/ fails.
What does a pattern match return when it fails?
The 'perlop' man page says it will return the empty string
in a scalar context.
: I had split the line around quoted text [i.e. @FIELDS = split
: (/(["].+?["])/, $curr);]. I wanted to join the line back together
: around the quotes after processing. So, if I originally had a line
: like:
: text1 "text inside quotes" text2
: When I split this line I get three elements in @FIELDS like this:
: $FIELDS[0] = text1
: $FIELDS[1] = "text inside quotes"
: $FIELDS[2] = text2
: I then do some modifications on each element of the array. When I am
: done I join the array back together and get:
: modified_text1 "modified text inside quotes" modified_text2.
: This is working as designed
It is working purely by accident.
Try putting anything with a double quote in $_ anywhere else
before this code, and see what it does.
$_ = '"';
: accept I don't know why the warning
: message appears. Are you saying that I need to initialize the special
: variable $_ to get rid of the warning? Would that cause problems?
"get rid of the warning" is never the approach to take.
"understand the warning, *then* fix the code so it does not
generate the warning" is how you should approach warnings
from perl.
The clever folks that programmed perl usually
have a pretty good reason for wanting to warn you about
something.
Take some of their wisdom for your own by understanding
what caused the warning.
I'm saying if you want to join with an empty string,
then give join() and empty string, not an expression that
happens to give an empty string sometimes:
$curr = join('', @fields);
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Sun, 08 Nov 1998 04:07:53 GMT
From: aali@ix.netcom.com (Abdul Ali)
Subject: Re: Perl Warning Message?
Message-Id: <364515da.43634255@nntp.ix.netcom.com>
On Sat, 7 Nov 1998 16:08:22 -0500, rjk@coos.dartmouth.edu (Ronald J
Kimball) wrote:
>Abdul Ali <aali@ix.netcom.com> wrote:
>
>> [...problem with join /["]/, @FIELDS...]
>
>> This is working as designed accept I don't know why the warning
>> message appears. Are you saying that I need to initialize the special
>> variable $_ to get rid of the warning? Would that cause problems?
>
>That would be one way to get rid of the warning... It certainly
>wouldn't do what you intend, though.
>
>Unlike split, the first argument to join is a *string*, not a regular
>expression.
>
>
>Consider:
>
>join /["]/, @FIELDS;
> # apply the regex /["]/ to the value of $_
> # join @FIELDS together with the result
> # (the result will be 1 if the regex matches, '' if not)
>
>join '"', @FIELDS;
> # join @FIELDS together with the double-quote character
>
>
>Just so you know, you don't actually need to put double-quotes inside a
>character class in a regex. These do the same thing:
>/["]/
>/"/
Thanks everyone,
Now I understand. I accidentally achieved success because I joined on
the null string which is what I really wanted.
I went back and changed my join statement to join('',@FIELDS). This is
now programmed correctly and no warning is issued. I also corrected
the unnecessary use of the character class.
Abdul
--
Learn: Pick at the ground until a hole appears.
Pick at the hole until a well appears. Then,
take a drink of cool, refreshing knowledge.
------------------------------
Date: Sat, 7 Nov 1998 13:51:28 -0800
From: "Carl Brink" <strat@centralnet.net>
Subject: Perl5 Win32::ODBC SQL Statement Involing dates
Message-Id: <3644c1fb.0@news.pacifier.com>
I have researched the Perl Win32 Database FAQ, Intro to SQL, Roth's ODBC man
page, and Joe's WIN32::ODBC Tutorial and I can not solve this problem.
the code:
if ($dbSched->Sql("SELECT
DAY_NUM,RECORDDATE,EMPNAME,SSN,STARTVAL,STOPVAL,TIMETYPE " .
"FROM Schedule " .
"WHERE TIMETYPE = 'S' AND " .
"(RECORDATE BETWEEN {d'$SQLDATE'} AND
{d'$SQLDATE14'})")) {
my $SQLError = $dbSched->Error;
die "SQL Error\n\t$SQLError";
} ###END OF if ($dbSched = Sql...
the error:
SQL Error
[-3010] [2] [0] "[Microsoft][ODBC dBase Driver] Too few parameters.
Expected 1." at C:\Perl\perldev\chkhour.pl line 136.
If anyone sees what I am missing I would appreciate a post or email
Christian Brink
strat@pacifier.com
------------------------------
Date: Sun, 08 Nov 1998 00:59:03 +0100
From: R. A. Larsen <r_larsen@image.dk>
Subject: Re: PLEASE HELP!
Message-Id: <VA.00000073.008d79d6@octo>
gpb@ppaolucci.com (Gord Barentsen) wrote:
>
> On Fri, 6 Nov 1998 12:11:22 GMT, Brent Michalski
> <perlguy@technologist.com> wrote:
> [please include code example]
[most of the code snipped]
> ------------------------------------------------------------------------
> HTMLHEAD.PL
>
> #!d:\Program Files\sambar41\perl\perl.exe
>
> sub HTML_Header
>
> {
> print "\n","<HTML><HEAD>","\n\n";
> print "<title>",@_,"</title>","\n\n";
> print "</HEAD>","\n\n";
>
> }
>
1; # see perldoc -f require
> #END HTML_Header
'perldoc -f require' gives:
Note that the file will not be included twice under the
same specified name. The file must return TRUE as the
look here-------------------------------------^^^^
last statement to indicate successful execution of any
initialization code, so it's customary to end such a
file with "1;" unless you're sure it'll return TRUE
and here-------^^
otherwise. But it's better just to put the "`1;'", in
case you add more statements.
I hope this helps.
Reni
--
Using Virtual Access
http://www.vamail.com
------------------------------
Date: Sat, 07 Nov 1998 16:09:01 +0100
From: drobick <drobick@arco.met.fu-berlin.de>
Subject: seriel or ttyS0
Message-Id: <3644628C.A9A96DDA@arco.met.fu-berlin.de>
hey
i search demo-program for programming com1: or ttyS0
cant help?
------------------------------
Date: Sat, 07 Nov 1998 22:33:39 +0100
From: Matevz Sernc <euhost@euhost.com>
Subject: start a program with exec();
Message-Id: <3644BCB2.41AA27ED@euhost.com>
Hi
i want to start a program in my cgi with the perl command "exec".
Yes i know that it never returns, but thats what i want.
exec("rundig"); should run in background for 1-2 hours, so i cant
start it with system, because i also do not want to return me something.
But my PROBLEM is that the called program cant run with the browsers
"nobody" user.
I must start the "rundig" with my full login/pass access, is this
possible ??
Thank you very much
Matevz Sernc
------------------------------
Date: Sat, 07 Nov 1998 21:48:35 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: start a program with exec();
Message-Id: <Pine.GSO.4.02A.9811071347180.21718-100000@user2.teleport.com>
On Sat, 7 Nov 1998, Matevz Sernc wrote:
> I must start the "rundig" with my full login/pass access, is this
> possible ??
Maybe you want a set-id program. See perlsec and your system's manpages
for more information. Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Sat, 07 Nov 1998 20:06:33 -0500
From: brent verner <damonbrent@earthlink.net>
Subject: trouble with grep....
Message-Id: <3644EE99.F522BE91@earthlink.net>
i am trying to remove duplicate items from array...but this doesn't work
... seems like it should, could anyone explain to me why this doesn't
work.
foreach $item(@array)
{
push @new, $item unless grep /$item/, @new;
}
i can 'print grep /$item/, @new;' and see that it returns the number of
items, but the test isn't allowing a push. i'm *really* confused here...
thanks,
brent
------------------------------
Date: 8 Nov 1998 02:39:25 GMT
From: Lee.Lindley@bigfoot.com
Subject: Re: trouble with grep....
Message-Id: <72308t$7b$1@rguxd.viasystems.com>
brent verner <damonbrent@earthlink.net> wrote:
:>i am trying to remove duplicate items from array...but this doesn't work
:>... seems like it should, could anyone explain to me why this doesn't
:>work.
:>foreach $item(@array)
:>{
:> push @new, $item unless grep /$item/, @new;
:>}
You probably should use a hash here instead of the array "new".
Acutally, there are a number of ways to get a unique set of values,
and the efficiency of each depends on properties of the original
set elements as well as on the size and randomness of the
original set.
In perl 5.00502 I tried "perldoc -q unique" and got some pretty
good examples (but they require a little thinking :-) ).
But to answer your question, the code you posted works for me.
Here is the output from running it in the debugger (perl 5.00502
on Solaris 2.5.1):
DB<1> @array = qw/item1 item2 item1 item2 item3/;
DB<2> @new = ();
DB<3> for $item (@array) {push @new, $item unless grep /$item/, @new;}
DB<4> x @array
0 'item1'
1 'item2'
2 'item1'
3 'item2'
4 'item3'
DB<5> x @new
0 'item1'
1 'item2'
2 'item3'
DB<6>
--
// Lee.Lindley | There was a time when I thought that "being right"
// @bigfoot.com | was everything. Then I realized that getting along
// | was more important. Still, being right is more fun!
// | If I'm wrong, somebody will get some joy out of telling me. :-)
------------------------------
Date: Sat, 07 Nov 1998 08:32:34 GMT
From: nicolasr@arrakis.es (Nicolas Rodrmguez)
Subject: Re: VARIABLES DE ENTORNO CGI
Message-Id: <3644028c.1136012@news.arrakis.es>
On Mon, 02 Nov 1998 16:35:50 -0500, fl_aggie@thepentagon.com (I R A
Aggie) wrote:
>In article <MPG.10a7b0eaedbcfe11989858@nntp.hpl.hp.com>, lr@hpl.hp.com
>(Larry Rosler) wrote:
>
>+ Actually, that's surprisingly comprehensible. (variable of surroundings
>+ == environment variable, etc.) But it isn't a Perl question, so I won't
>+ answer it. :-)
>
>I think you meant to say:
>
>Realmente, eso es asombrosamente comprensible. (variable de la variable de
>entorno del == de los alrededores, del etc.) Pero no es una pregunta del
>Perl, asm que no le contestari. :-)
>
>HTH
>
>James
Hola, James
Gracias por contestar en espaqol.
Estoy de acuerdo en que no es una pregunta de Perl. Pero para mi es
casi igual ya que todos los scrips CGI los escribo en Perl. Si puedes
responder a mi pregunta te agradecerma que lo hicieras.
Nicolas Rodriguez
nicolasr@arrakis.es
------------------------------
Date: Sat, 07 Nov 1998 23:14:16 GMT
From: hup@my-dejanews.com
Subject: Re: Which is the better choice? mod_perl, fastcgi, embperl ..
Message-Id: <722k89$us0$1@nnrp1.dejanews.com>
Hi,
Thank for your reply.
Yes, I am using Apache, ver 1.3.3.
After several times of testing, I still don't be able to make my existing
perl script port to mod_perl, it just continuely fork out large httpd, don't
find any performance improving. (I believe it is my problem, but don't
know how to solve it, do you have any idea?)
At last, I go to FastCGI, so far it's working well, the performance look
better than without FastCGI.
I don't know about the stability of FastCGI. I would love to try to
port my existing code to mod_perl, although it already work for FastCGI.
Thank and Best Regads,
Hup
> FastCGI is complicated and hard to scale. It's like making a bunch
> of standalone servers to handle requests instead of exec()ing a
> normal CGI. For small numbers of heavily used scripts (a search
> system for instance), it can work well. For more standard form
> processing CGI and/or large numbers of CGI programs it doesn't.
>
> : And which one can let my existing perl script working well
> : without painful convert?
> : thank a lot.
>
> mod_perl, if you're on Apache of course (and if you're looking for
> performance we assume you're already running Apache:-). The
> Apache::Registry module that comes with mod_perl can *massively*
> speed most of your existing Perl CGI programs *untouched*.
>
> You can use mod_perl to run embedded perl on the fly as well.
>
> The ability to quickly create full fledged Apache server modules
> completely within Perl can not be discounted either. This alone
> is a *huge* amount of power over any other web server, and
> considering there speed (both runtime and development) for many
> common operations leaves little reason to ever use C.
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 12 Jul 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 Mar 98)
Message-Id: <null>
Administrivia:
Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.
If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu.
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 4175
**************************************