[10579] in Perl-Users-Digest
Perl-Users Digest, Issue: 4171 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Nov 6 23:07:39 1998
Date: Fri, 6 Nov 98 20:00:20 -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 Fri, 6 Nov 1998 Volume: 8 Number: 4171
Today's topics:
Re: Denying repeated submissions... <Jim_Barlow@bc.sympatico.ca>
Re: Denying repeated submissions... <zenin@bawdycaste.org>
exact search <webmaster@eswap.co.uk>
Re: exact search <rootbeer@teleport.com>
Re: Example of subclassing in Perl ?? <zenin@bawdycaste.org>
FIFO vs. async. ()
If -e different then If -d on a Directory, why? <stowians@ford.com>
Re: If -e different then If -d on a Directory, why? <rootbeer@teleport.com>
Re: If -e different then If -d on a Directory, why? <zenin@bawdycaste.org>
Re: indenting perl elsif clauses in emacs <pup@pobox.com>
Re: MacPerl Help, Please! (John Moreno)
Re: OLE Sub routine scalar assignment problem (John Hardy)
Re: OLE Sub routine scalar assignment problem <rootbeer@teleport.com>
Re: Pattern matching (Ronald J Kimball)
Perlshop and SSI <saij@gate.net>
Re: Perlshop and SSI <rootbeer@teleport.com>
pod2html and <BR> and L<text> tags <aravind@genome.wi.mit.edu>
Re: Printing contents of stderr (Larry Rosler)
problem in using "require" function on sambar server <marcop@chollian.net>
Re: problem in using "require" function on sambar serve imchat@ionet.net
Re: readdir bug in win95 perl 5.00402? - test script (Ronald J Kimball)
Re: redirecting interpreter output <rebelvideo@hotmail.com>
Re: shift in a list context (Awrobinson)
system interaction (starting and killing a process) imchat@ionet.net
Re: system interaction (starting and killing a process) <rootbeer@teleport.com>
Re: system interaction (starting and killing a process) imchat@ionet.net
Re: What is the "correct" location of perl under Solari (Ronald J Kimball)
Which is the better choice? mod_perl, fastcgi, embperl hup@my-dejanews.com
Re: Which is the better choice? mod_perl, fastcgi, embp <zenin@bawdycaste.org>
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 6 Nov 1998 17:04:41 -0800
From: "J Barlow" <Jim_Barlow@bc.sympatico.ca>
Subject: Re: Denying repeated submissions...
Message-Id: <7206eh$5al$1@news.bctel.net>
Well, like Tom (?) said, there's no fair way, but why not send a cookie?
Deny voting if the cookie is rejected, and set the cookie's expiry date to
either the date of your next poll, or 24 hours from the present time
according to your server. This way, each internet connection can vote each
24 hours... unless of course they delete the cookie.........
Larry wrote in message <364386F7.392F@kami.com>...
[snip]
>I've written a web page that asks the viewer to submit a choice
>(a vote). I'd like to be able to prevent the page viewer from
>submitting multiple ballots from one dial-up session.
>Larry
------------------------------
Date: 07 Nov 1998 01:24:22 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: Denying repeated submissions...
Message-Id: <910401765.266994@thrush.omix.com>
J Barlow <Jim_Barlow@bc.sympatico.ca> wrote:
: Well, like Tom (?) said, there's no fair way, but why not send a cookie?
: Deny voting if the cookie is rejected, and set the cookie's expiry date to
: either the date of your next poll, or 24 hours from the present time
: according to your server. This way, each internet connection can vote each
: 24 hours... unless of course they delete the cookie.........
http://www.archive.rhps.org/poll/
The table of contents (the URL above) tries to set the cookie. This
way when you look at/take a poll it knows already if cookies are
supported. If you've got cookies it uses them, if not it falls back
to your IP.
This is about as fair as it gets for web based polls unless you want
to anoy people with "login" crud. More then one person per account
(a family of people, etc) shouldn't be an issue as they should
already have Netscape or whatever setup with a different "profile"
per user. If they have a problem with this, they can simply not
take the poll. "You can't please all the people all the time".
--
-Zenin (zenin@archive.rhps.org) From The Blue Camel we learn:
BSD: A psychoactive drug, popular in the 80s, probably developed at UC
Berkeley or thereabouts. Similar in many ways to the prescription-only
medication called "System V", but infinitely more useful. (Or, at least,
more fun.) The full chemical name is "Berkeley Standard Distribution".
------------------------------
Date: Fri, 6 Nov 1998 17:40:04 -0800
From: "E-swap" <webmaster@eswap.co.uk>
Subject: exact search
Message-Id: <7208mi$m7p@dfw-ixnews10.ix.netcom.com>
Hi
I am trying to submit an exact search through an array in files I have and
am using:
if (($cat[0] =~ /$form{'searchstring2'}\b/i)
but, if I search for ED it is also returning entries for RED ... any ideas??
Thanks for all help
------------------------------
Date: Sat, 07 Nov 1998 01:48:11 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: exact search
Message-Id: <Pine.GSO.4.02A.9811061746350.20411-100000@user2.teleport.com>
On Fri, 6 Nov 1998, E-swap wrote:
> I am trying to submit an exact search through an array in files I have
> and am using:
>
> if (($cat[0] =~ /$form{'searchstring2'}\b/i)
If you really want an exact search, maybe you want to use index(), rather
than a pattern match. Or maybe you want to use \Q.
> but, if I search for ED it is also returning entries for RED ... any
> ideas??
Do you know what that \b is doing in the pattern? That may get you on the
right track. Good luck!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 07 Nov 1998 00:55:37 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: Example of subclassing in Perl ??
Message-Id: <910400042.444501@thrush.omix.com>
Joe McMahon <joe.mcmahon@gsfc.nasa.gov> wrote:
: In article <71vp41$og2$1@nnrp1.dejanews.com>, rohanoberoi@my-dejanews.com wrote:
: >This doesn't seem to work. Any idea why?
: See comments below. You've missed several important ideas.
No, he's only missed one.
: 1) @ISA is necessary to define the inheritance structure.
base.pm does this.
: 2) You do not understand the 'use' operator.
base.pm does this.
: 3) You do not understand how to call a subroutine as a method.
This is the only problem.
: >opal:[~] more Bar.pm
: >package Bar;
: >use base qw(Foo);
: Falls under (1,2). This tries to use base.pm's Foo routine. You mean
: use Foo;
No, he means 'use base qw(Foo);'. Please see `perdoc base' before
making assumptions to its calling semantics, or any module for that
matter.
import() can do anything it likes, and so many modules don't
import any functions (CGI::Carp qw(fatalsToBrowser), Opcode,
strict, vars, subs, re, and on and on).
: You also do not define the inheritance - problem (1). Add the line
: @ISA = qw(Foo);
Not needed, base.pm does this.
>snip<
: Problem (3). Wrong call syntax, if you want inheritance. You mean
: print Foo->foo(),"\n";
Problem (1) of (1). This is the only thing he missed.
>snip<
: Read 'perldoc perltoot'. It will help a lot.
Read `perldoc base'. It will help a lot. Also see perlmod for
full import() semantics.
--
-Zenin (zenin@archive.rhps.org) From The Blue Camel we learn:
BSD: A psychoactive drug, popular in the 80s, probably developed at UC
Berkeley or thereabouts. Similar in many ways to the prescription-only
medication called "System V", but infinitely more useful. (Or, at least,
more fun.) The full chemical name is "Berkeley Standard Distribution".
------------------------------
Date: Sat, 07 Nov 1998 01:25:51 GMT
From: spam@mail.stumpworld.com ()
Subject: FIFO vs. async.
Message-Id: <zkN02.216$lw.15014@news.shore.net>
I've written a simple custom TCP server that currently handles connections
in a synchronous manner (FIFO), but I'm worried that a bad client instance
will muck up the whole thing.
My question is, does anyone have any suggestions about how best to go about
writing an asynchronous TCP port listener? Using Socket, is there some easy
way to have it handle multiple connections better that I've overlooked?
Right now what I have is pretty straightforward,
use Socket;
connection initialization
send/recv handlers for dialog.
etc.
Please reply via the e-mail at the bottom if possible.
Thanks in advance,
-Matt
--
To reply directly, transpose the "@" and the "." in the address below:
mattd.stumpworld@com
------------------------------
Date: Fri, 06 Nov 1998 19:56:37 -0500
From: Stan Towianski <stowians@ford.com>
Subject: If -e different then If -d on a Directory, why?
Message-Id: <36439AC5.57D6@ford.com>
Hi,
Why does -e for a non-existent directory
return ok but -d returns not ok like I would expect?
if ( -e "/whatever/path/does/not/exist/" )
{
print "path does -e\n";
}
else
{
print "path does NOT -e\n";
}
if ( -d "/whatever/path/does/not/exist/" )
{
print "path does -d\n";
}
else
{
print "path does NOT -d\n";
}
------------------------------
Date: Sat, 07 Nov 1998 01:20:40 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: If -e different then If -d on a Directory, why?
Message-Id: <Pine.GSO.4.02A.9811061715410.20411-100000@user2.teleport.com>
On Fri, 6 Nov 1998, Stan Towianski wrote:
> Why does -e for a non-existent directory
> return ok but -d returns not ok like I would expect?
If the -e filetest returns true for a name that doesn't exist, it's broken
and you should probably file a bug report.
perl -le 'print "oops" if -e "/this/file/or/dir/does/not/exist"'
Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 07 Nov 1998 01:31:01 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: If -e different then If -d on a Directory, why?
Message-Id: <910402164.259056@thrush.omix.com>
Stan Towianski <stowians@ford.com> wrote:
: Why does -e for a non-existent directory
: return ok but -d returns not ok like I would expect?
It does? It shouldn't, nore does it for me:
$ perl foo.pl
path does NOT -e
path does NOT -d
Please make sure you are using this exact piece of code
when testing. If you still find this happening, please
use perlbug to submit a bug report, thanks.
: if ( -e "/whatever/path/does/not/exist/" )
: {
: print "path does -e\n";
: }
BTW, this style of code is advocated by pretty much no one outside
of Python. For the sake of your fellow programmers, please
consider using this form (with 4 space indent, not 3):
if (-e "/whatever/path/does/not/exist/") {
print "path does -e\n";
}
else {
...stuff...
}
Thanks.
--
-Zenin (zenin@archive.rhps.org) From The Blue Camel we learn:
BSD: A psychoactive drug, popular in the 80s, probably developed at UC
Berkeley or thereabouts. Similar in many ways to the prescription-only
medication called "System V", but infinitely more useful. (Or, at least,
more fun.) The full chemical name is "Berkeley Standard Distribution".
------------------------------
Date: Fri, 6 Nov 1998 22:27:10 -0500
From: "Joel Burton" <pup@pobox.com>
Subject: Re: indenting perl elsif clauses in emacs
Message-Id: <720eg0$18c$1@autumn.news.rcn.net>
tbhanson@startribune.com wrote in message
<71smlm$mnc$1@nnrp1.dejanews.com>...
>Hmmm, can anyone explain how to get emacs in perl mode to indent elsif
clauses
Have you tried CPerl mode? I've found it much more functional at handling
indents and such.
------------------------------
Date: Fri, 6 Nov 1998 22:01:05 -0500
From: phenix@interpath.com (John Moreno)
Subject: Re: MacPerl Help, Please!
Message-Id: <1di3dfp.1m3trpi56upuhN@roxboro0-024.dyn.interpath.net>
Brian Estep <estepb@ipix.com> wrote:
> Hi! I have written a program that checks to see if a website is down, and
> now I need to add functionality to it to page me via email. However, I
> can't seem to get MacPerl to use the standard LIBWWW mail commands (I think
> they are more meant for UNIX.) Has anyone else run into this with MacPerl?
> If so, please help, I'm at a standstill.
What version are you using - libwww works just fine for me.
--
John Moreno
------------------------------
Date: Sat, 07 Nov 1998 03:41:56 GMT
From: jhardy@cins.com (John Hardy)
Subject: Re: OLE Sub routine scalar assignment problem
Message-Id: <8kP02.662$sF2.290549@198.235.216.4>
In article <Pine.GSO.4.02A.9811061359070.20411-100000@user2.teleport.com>,
rootbeer@teleport.com says...
>
>On Fri, 6 Nov 1998, John Hardy wrote:
>
>> The problem I am having below is when the script reaches:
>> $CMD->ActiveConnection=$Conn;
>>
>> PERL complains "Can't modify subroutine entry in Scalar assignment at
>> line 95 near "$Conn;" "
>>
>> I don't understand??
>
>Have you seen what perldiag says about this message?
Couldn't find anything in PERLDIAG
>
>> Can anyone tell me the proper way to do this??
>
>I'm sure someone can. Just what is it that you're trying to do? Is it
>covered in the docs for the module you're using?
No , could not find anything similar in the Docs.
I think what I'm trying to do is pretty obvious, or should be
to an expert, even if it is not written as it may best be done.
Hope this helps!
>
Nope, didn't help.........Thanks anyway!
>--
>Tom Phoenix Perl Training and Hacking Esperanto
>Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
>
------------------------------
Date: Sat, 07 Nov 1998 03:48:58 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: OLE Sub routine scalar assignment problem
Message-Id: <Pine.GSO.4.02A.9811061945460.20411-100000@user2.teleport.com>
On Sat, 7 Nov 1998, John Hardy wrote:
> >> PERL complains "Can't modify subroutine entry in Scalar assignment at
> >> line 95 near "$Conn;" "
> >>
> >> I don't understand??
> >
> >Have you seen what perldiag says about this message?
> Couldn't find anything in PERLDIAG
It's in perldiag, the manpage of Perl's diagnostic messages. If it's not
in your copy of perldiag, install 5.004 or later.
> >> Can anyone tell me the proper way to do this??
> >
> >I'm sure someone can. Just what is it that you're trying to do? Is it
> >covered in the docs for the module you're using?
> No , could not find anything similar in the Docs.
>
> I think what I'm trying to do is pretty obvious, or should be
> to an expert, even if it is not written as it may best be done.
I'm sure you're right. Good luck!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Fri, 6 Nov 1998 22:09:47 -0500
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: Pattern matching
Message-Id: <1di3dbh.rdphuytdf8y8N@bay1-458.quincy.ziplink.net>
Alan Dye <alan@akqa.com> wrote:
> No it means that the script needs to be portable between servers and
> not have to require modules.
If you can transfer the script between servers, then you can transfer
the necessary modules between servers.
--
_ / ' _ / - 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: Fri, 06 Nov 1998 20:25:34 -0500
From: saij <saij@gate.net>
Subject: Perlshop and SSI
Message-Id: <3643A18E.AC942FCD@gate.net>
Has anyone ever incorporated SSI with Pershop to inerface with a
database? I am having trouble with Perlshop not parsing the SSI "#exe
cgi"command.
saij@gate.net
------------------------------
Date: Sat, 07 Nov 1998 01:27:20 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Perlshop and SSI
Message-Id: <Pine.GSO.4.02A.9811061726420.20411-100000@user2.teleport.com>
On Fri, 6 Nov 1998, saij wrote:
> Has anyone ever incorporated SSI with Pershop to inerface with a
> database? I am having trouble with Perlshop not parsing the SSI "#exe
> cgi"command.
Sounds as if you're having troubles with a web server. The docs, FAQs, and
newsgroups about servers should be useful. Good luck!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Fri, 06 Nov 1998 18:09:09 -0500
From: Aravind Subramanian <aravind@genome.wi.mit.edu>
Subject: pod2html and <BR> and L<text> tags
Message-Id: <36438195.F0E490C6@genome.wi.mit.edu>
Is there a way to tell the pod2html translator to insert a <BR>? The
only way I have been able to place 2 sentences on separate lines is by
placing an empty line between them. (the lines are *not* items)
How does pod2html resolve links (given using the L<text> tag)? It
appears that the linked files need to be in the same
directory(structure) as the module that is being podized. Maybe I'm
mistaken. What would be nice is if it was able to look up a * file* for
the links corresponding to the string specified within the L<text> tag
rather than specifying a podroot dir. The libpods command line switch is
too cumbersome.
Is anyone aware of scripts that improve upon the HTML formatting done by
pod2html - for example scripts that allow setting of background color
and font.
I'd appreciate any suggestions.
Thanks,
aravind
------------------------------
Date: Fri, 6 Nov 1998 17:16:05 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Printing contents of stderr
Message-Id: <MPG.10ad3f2bdb9c6540989865@nntp.hpl.hp.com>
[Posted to comp.lang.perl.misc and a copy mailed.]
In article <36437512.AFD304A9@rit.edu> on Fri, 06 Nov 1998 17:15:47 -
0500, dan B hentschel <dbh6913@rit.edu> says...
...
> @array = eval($1);
...
> If there are syntax errors, then
> TestIdents will write an awful lot of helpful information to stderr
> about the problems with the settings file. Unfortunately, I don't know
> of any way of getting the contents of stderr to go to a web client. So I
> have written some code that, in the event of a syntax error, will make
> an attempt at analyzing the syntax of the settings file. It works, but I
> would still prefer to show the errors written to stderr because they
> will often be much more helpful than the code I have written here. Is
> there any way that I can put the contents of stderr into a variable so
> that I can print them out?
If 'eval' fails, it puts its error message into the special variable $@.
You can take it from there.
`perldoc -f eval`
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Sat, 07 Nov 1998 02:41:24 GMT
From: "Ha,Yoon-Hyang" <marcop@chollian.net>
Subject: problem in using "require" function on sambar server
Message-Id: <01be09f8$9d1b3d20$44a378d2@Magicall2.dacom.co.kr>
$)CHi,
I'm a beginner of PERL programming.
Yesterday, I set sambar server program on my PC (win95).
I could make it possible to test my perl program without on-line
connection.
However, the perl script which contains "require" function have a
problem in its execution.
I got an error message such as "unexpected error occured, restart explorer
and try again" from browser.
And I got also an error message when I executed it in dos mode like
"can't locate htmlhead.pl in @INC at c:\progra~1\sambar41\cgi-bin\
hellowww.pl line 7".
So, I tried to put the path in @INC using -P -I option, push, or
unshift, but it didn't work, never changed!
@INC contains only c:\perl\lib\i386-win32, c:\perl\lib, and ".".
When I moved the subroutine contained program (htmlhead.pl & htmlend.pl)
to c:\perl\lib, at that time, it showed me such error message like
"htmlhead.pl did not return a true value at c:\progra~1\sambar41
\cgi-bin\hellowww.pl line 7".
I've leared that "." means a current path, but I'm not sure what the
current path is and what is wrong.
My perl interpreter located c:\perl\bin\perl.exe, sambar was set c:\
program files\sambar41\..., and the perl programs which contained
"require" function and subroutine are located c:\program files\sambar41
\cgi-bin\.
I think the fault is in me, but I can not find it.
Please help me in solving this fundamental problem.
I'll wait your kind response.
Thank you.
S.C.Lee
------------------------------
Date: Sat, 07 Nov 1998 03:40:39 GMT
From: imchat@ionet.net
Subject: Re: problem in using "require" function on sambar server
Message-Id: <3643c00a.23658779@news.ionet.net>
You might want to use the Xitami web server (imatix.com) for
testing puposes. Its extremely easy to setup, is very forgiving, and
is excellent for debugging as long as you dont do sendmail or
anything. I haven't had any problem with requires on it yet.
Sorry, don't know much about Sambar.
On Sat, 07 Nov 1998 02:41:24 GMT, "Ha,Yoon-Hyang"
<marcop@chollian.net> wrote:
>$)CHi,
>I'm a beginner of PERL programming.
>Yesterday, I set sambar server program on my PC (win95).
>I could make it possible to test my perl program without on-line
>connection.
>However, the perl script which contains "require" function have a
>problem in its execution.
>I got an error message such as "unexpected error occured, restart explorer
>and try again" from browser.
>And I got also an error message when I executed it in dos mode like
>"can't locate htmlhead.pl in @INC at c:\progra~1\sambar41\cgi-bin\
>hellowww.pl line 7".
>So, I tried to put the path in @INC using -P -I option, push, or
>unshift, but it didn't work, never changed!
>@INC contains only c:\perl\lib\i386-win32, c:\perl\lib, and ".".
>When I moved the subroutine contained program (htmlhead.pl & htmlend.pl)
>to c:\perl\lib, at that time, it showed me such error message like
>"htmlhead.pl did not return a true value at c:\progra~1\sambar41
>\cgi-bin\hellowww.pl line 7".
>I've leared that "." means a current path, but I'm not sure what the
>current path is and what is wrong.
>My perl interpreter located c:\perl\bin\perl.exe, sambar was set c:\
>program files\sambar41\..., and the perl programs which contained
>"require" function and subroutine are located c:\program files\sambar41
>\cgi-bin\.
>
>I think the fault is in me, but I can not find it.
>Please help me in solving this fundamental problem.
>I'll wait your kind response.
>
>Thank you.
>
>S.C.Lee
>
------------------------------
Date: Fri, 6 Nov 1998 22:09:48 -0500
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: readdir bug in win95 perl 5.00402? - test script
Message-Id: <1di3dl6.65a697ad9kanN@bay1-458.quincy.ziplink.net>
Dan Baker <dtbaker-@busprod.com> wrote:
[foolishness snipped]
Yes, there is a bug, but it's not in the script you posted.
The bug is in the programmer, who failed to read the documentation for
readdir:
If you're planning to filetest the return values out of a readdir(),
you'd better prepend the directory in question. Otherwise, because
we didn't chdir() there, it would have been testing the wrong file.
--
_ / ' _ / - 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 13:34:09 +1030
From: rebel <rebelvideo@hotmail.com>
Subject: Re: redirecting interpreter output
Message-Id: <3643B8A9.EB13A296@hotmail.com>
Thanks for the tip I'll give it a try
R. A. Larsen wrote:
>
> rebel <rebelvideo@hotmail.com> wrote:
> [has a problem redirecting STDERR from the perl interpreter]
>
> I have a program that does exactly what you want. I have downloaded
> DJGPP V2 (a MS-DOS port of gcc) and one of the programs included is
> called redir.
>
> Here is some info from the manual:
>
> This is the reference manual for the miscellaneous utility programs that
> come with DJGPP.
>
> [cut]
>
> * redir:: Manage I/O Redirection.
>
> [cut]
>
> redir
> *****
>
> DOS, in its many flavors and versions, lacks a decent I/O redirection
> mechanism. Sure, it's got < and > and >>, but what about error
> messages? Lots of people ask, "How do you send those error messages to
> a file?" Well, you use a program like `redir'.
>
> `redir' is basically a program that manipulates the standard file
> descriptors by copying them, closing and opening them, etc. Once it
> has the file descriptors where it wants them, it runs your program,
> which inherits the changed descriptors. Thus, `redir' has nearly
> complete control over the input and output of your program.
>
> [cut]
>
> I am not sure if you what file(s) to download in order to get this
> program.
>
> Try looking for it on any SimTel.NET mirror in the
> pub/simtelnet/gnu/djgpp/ subdirectory.
>
> I hope this helps.
>
> Reni
> --
> Using Virtual Access
> http://www.vamail.com
------------------------------
Date: 7 Nov 1998 01:43:48 GMT
From: awrobinson@aol.com (Awrobinson)
Subject: Re: shift in a list context
Message-Id: <19981106204348.04051.00000329@ng11.aol.com>
>From: Colin Kuskie <ckuskie@cadence.com>
>RTM, shift and pop only return one element. If you want more
>than one, then use splice(). Or use shift several times:
>
>my $first = shift;
>my $second = shift;
This is what I thought, but I find out about things about Perl I didn't know
every day. I do read perldoc. I don't read the FAQ as much as I should. But
even for things I thought I understand, I find that there are perl 'idioms'
that I do not know about. So at the risk of being ridiculed (which I get a lot
on these newgroups), I ask. Thanks for the straight answer Colin.
Andrew Robinson
---
Disclaimer: The opinions expressed are mine alone and do not represent the
views of America Online
------------------------------
Date: Sat, 07 Nov 1998 02:04:19 GMT
From: imchat@ionet.net
Subject: system interaction (starting and killing a process)
Message-Id: <3643a8ce.17710145@news.ionet.net>
Hi, I have some scripts that I want to use to start and kill
processes. They work fine when I include the command line but when I
use scalers to assign the value from a form it goes to pieces and
doesn't do anything. Output from telnet doesn't tell me anything
because it works. Heres what I have so far.
#!/usr/bin/perl -w
require "cgi-lib.cgi";
&ReadParse(*form_data);
if ($form_data{'start'} ne "")
{
$start = $form_data{'start'};
}
else
{
$start = "";
}
select(STDOUT); $|++; print STDOUT <<EOF;
Content-type: text/plain\n\n
Starting your process.
EOF
system('$start');
exit;
I've tried exec also with the same result. The scaler isn't
being parsed through or something. Any idea's?
------------------------------
Date: Sat, 07 Nov 1998 02:22:42 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: system interaction (starting and killing a process)
Message-Id: <Pine.GSO.4.02A.9811061807310.20411-100000@user2.teleport.com>
On Sat, 7 Nov 1998 imchat@ionet.net wrote:
> Hi, I have some scripts that I want to use to start and kill
> processes. They work fine when I include the command line but when I
> use scalers to assign the value from a form it goes to pieces and
> doesn't do anything. Output from telnet doesn't tell me anything
> because it works.
Because _what_ works? Telnet? Some script that you haven't shown us? The
command line? The form? A scalar? That 'it' has too many possible
referents, and yet I can't see even one that seems likely to be the one
you meant.
> #!/usr/bin/perl -w
>
> require "cgi-lib.cgi";
> &ReadParse(*form_data);
>
> if ($form_data{'start'} ne "")
You should know that you may be using undef as if it were a string here.
This could generate a warning. Maybe you simply want to check that you
have a defined value.
> {
> $start = $form_data{'start'};
> }
> else
> {
> $start = "";
> }
Okay, so you want $start to be either the empty string or the data from
the form.
> select(STDOUT); $|++; print STDOUT <<EOF;
> Content-type: text/plain\n\n
>
> Starting your process.
> EOF
Now, there's nothing _wrong_ with that, but it's unusual to write an
explicit \n into a here document. It's clearer to actually use the newline
character, and that's what I think you meant to do.
> system('$start');
Ahem. Now, let's forget the error for a moment. Do you really want to run
ANY COMMAND that ANYONE IN THE WORLD asks your server to run? Excuse me
for shouting, but that's the CGI programming equivalent of leaving your
keys in the ignition and abandoning your car in the bad part of town. Read
the perlsec manpage, the web security FAQ, and the CGI security FAQ before
you go on.
Really, read those documents. Right now. Don't worry about me, I'll wait
here until you get back.
Do you see now how your program, if it worked, would open a big security
hole in your system? Do you see why your system administrator shouldn't
let you put such scripts up for use over the web? Do you see why you
shouldn't trust a system administrator who would let anyone put such
scripts up for use over the web? Scary, isn't it?
Now read the perlop manpage to find out what argument you were passing to
system, and you'll see what you need to do if you really want to make this
program work like this.
> I've tried exec also with the same result.
Reading perlfunc's entries about system and exec would also be in order.
Good luck!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Sat, 07 Nov 1998 03:18:02 GMT
From: imchat@ionet.net
Subject: Re: system interaction (starting and killing a process)
Message-Id: <3643b1c9.20009311@news.ionet.net>
I realize the implications of the script and security, but its really
no worse than telnet access in responsible hands, though thats getting
hard to find out there. I am NOT letting anyone use my server to
execute any command they want, but it could be useful to people who
don't have telnet access because they bought their site from a
reseller. I agree security is paramount with scripts of this nature,
like a lot of security, and I don't intend to release this script to
the public. I only intend to use it for clients that don't have telnet
access that need to run my Java daemons.
>
>Because _what_ works? Telnet? Some script that you haven't shown us? The
>command line? The form? A scalar? That 'it' has too many possible
>referents, and yet I can't see even one that seems likely to be the one
>you meant.
Sorry, the scripts (I have other process cgi's based on the
same idea) work in a telnet session. They just don't work on the web.
>
>> #!/usr/bin/perl -w
>>
>> require "cgi-lib.cgi";
>> &ReadParse(*form_data);
>>
>> if ($form_data{'start'} ne "")
>
>You should know that you may be using undef as if it were a string here.
>This could generate a warning. Maybe you simply want to check that you
>have a defined value.
Basically that. Just trying to make sure.
>
>> {
>> $start = $form_data{'start'};
>> }
>> else
>> {
>> $start = "";
>> }
>
>Okay, so you want $start to be either the empty string or the data from
>the form.
>
>> select(STDOUT); $|++; print STDOUT <<EOF;
>> Content-type: text/plain\n\n
>>
>> Starting your process.
>> EOF
>
>Now, there's nothing _wrong_ with that, but it's unusual to write an
>explicit \n into a here document. It's clearer to actually use the newline
>character, and that's what I think you meant to do.
I can fix that.<G>
>
>> system('$start');
>
>Ahem. Now, let's forget the error for a moment. Do you really want to run
>ANY COMMAND that ANYONE IN THE WORLD asks your server to run? Excuse me
>for shouting, but that's the CGI programming equivalent of leaving your
>keys in the ignition and abandoning your car in the bad part of town. Read
>the perlsec manpage, the web security FAQ, and the CGI security FAQ before
>you go on.
Basic authentication will be added to the script for
protection against just anyone finding the script and trying to run
it, along with login procedures if I can get that working also.
Believe me, I definately don't want anyone being able to run this
script on any server with impunity. However, you have to admit it
would be nice for people who don't have telnet access to be able to
debug scripts, run daemons, and see how much cpu and mem their
programs are using on their own server.
The script in itself is no different than allowing a trusted
client to have telnet access. Certain security procedures are
implemented to guard against attacks to the root on any good server
setup. Hopefully!
>
>Really, read those documents. Right now. Don't worry about me, I'll wait
>here until you get back.
I'll read them all.
>
>Do you see now how your program, if it worked, would open a big security
>hole in your system? Do you see why your system administrator shouldn't
>let you put such scripts up for use over the web? Do you see why you
>shouldn't trust a system administrator who would let anyone put such
>scripts up for use over the web? Scary, isn't it?
Yes it would be scary if someone knew where these scripts were
on my server and they worked. I've already been hacked twice so I am
security concious. Nothing like getting a call from Iceland from an
ISP thats being port scanned from your server.
>
>Now read the perlop manpage to find out what argument you were passing to
>system, and you'll see what you need to do if you really want to make this
>program work like this.
>
>> I've tried exec also with the same result.
>
>Reading perlfunc's entries about system and exec would also be in order.
>
>Good luck!
>
>--
Thanks. I hope I can make this script fairly safe to use,
however there is always the person out there just waiting to find
something like this on someone elses server. I'll try to be careful.
>Tom Phoenix Perl Training and Hacking Esperanto
>Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
>
------------------------------
Date: Fri, 6 Nov 1998 22:09:49 -0500
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: What is the "correct" location of perl under Solaris?
Message-Id: <1di3eg6.1ws4fj21uelf5N@bay1-458.quincy.ziplink.net>
Martin Gregory <mgregory@asc.sps.mot.com> wrote:
> rjk@coos.dartmouth.edu (Ronald J Kimball) writes:
>
> > Martin Gregory <mgregory@asc.sps.mot.com> wrote:
> >
> > [executing perl when #! doesn't work]
>
> You mis-paraphrase me!
You're absolutely right. I didn't note the distinction between dealing
with non-working #! processing and dealing with an unknown path to perl.
The former is covered in perlrun, but that's not the question you were
answering. As you said, the latter is *not* covered in perlrun, and
that one is the question you were answering.
Sorry about that!
> How do I suggest that this solution be incorporated in perlrun?
Send a documentation patch to perlbug@perl.com
--
_ / ' _ / - 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 01:20:13 GMT
From: hup@my-dejanews.com
Subject: Which is the better choice? mod_perl, fastcgi, embperl ..
Message-Id: <72078d$4cu$1@nnrp1.dejanews.com>
Hi,
How is the stability and performance among mod_perl, fastcgi, embperl ..?
And which one can let my existing perl script working well
without painful convert?
thank a lot.
Best Regards,
Hup
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 07 Nov 1998 01:47:07 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: Which is the better choice? mod_perl, fastcgi, embperl ..
Message-Id: <910403129.657500@thrush.omix.com>
hup@my-dejanews.com wrote:
: How is the stability and performance among mod_perl, fastcgi, embperl ..?
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.
--
-Zenin (zenin@archive.rhps.org) From The Blue Camel we learn:
BSD: A psychoactive drug, popular in the 80s, probably developed at UC
Berkeley or thereabouts. Similar in many ways to the prescription-only
medication called "System V", but infinitely more useful. (Or, at least,
more fun.) The full chemical name is "Berkeley Standard Distribution".
------------------------------
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 4171
**************************************