[8730] in Perl-Users-Digest
Perl-Users Digest, Issue: 2347 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Apr 17 10:17:17 1998
Date: Fri, 17 Apr 98 07:00:35 -0700
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, 17 Apr 1998 Volume: 8 Number: 2347
Today's topics:
Re: 'strict' and filehandles <zenin@archive.rhps.org>
Re: .= so why not =. ? <jdporter@min.net>
Re: Argument checking code in combination with GetOptio (Johan Vromans)
Re: Argument checking code in combination with GetOptio <zenin@archive.rhps.org>
Re: cgi perl ? <grinch@whoville.com>
Re: cgi scripts to modify root-owned files and processe <grinch@whoville.com>
Re: cgi using perl <perlguy@inlink.com>
Re: cgi using perl <grinch@whoville.com>
Re: CLPM CONTENT POLICE (was info on cookies) <flavell@mail.cern.ch>
Crypt::IDEA-1.0 <Jean-Luc.Szpyrka@sophia.inria.fr>
Re: Farnham's Freehold <grinch@whoville.com>
Re: Farnham's Freehold <sowmaster@juicepigs.com>
Fork in perl/NT ? emmanuel_astier@yahoo.com
Re: Formatting script for Perl5... <due@discovernet.net>
Re: Hash of Arrays <jsrbirch@toad.net>
Re: Image instead of button in Perl Script <grinch@whoville.com>
launching external program on W95 <petter.bergman@ehpt.com>
Re: Multi-tasking/threading <zenin@archive.rhps.org>
Re: OOPS and several parents <grinch@whoville.com>
Re: PERL aware code editor <gurun@acc.umu.se>
Re: PERL aware code editor <due@discovernet.net>
perl from webpage dont work. perl works local but not a <acidbolt@yahoo.com>
Re: perl script for tacacs (shmoo)
Re: PIDs Finding and Killing them from a perl script <jsrbirch@toad.net>
Re: PIDs Finding and Killing them from a perl script <jamesr@aethos.co.uk.nospam>
Re: Profane foobar? (was: Re: .= so why not =. ?) <grinch@whoville.com>
Re: Recursive Calls in Perl ? <mca@ambrasoft.lu>
Re: Wanna laugh? (My First cgi.pm Script) <jdporter@min.net>
Re: Wanna laugh? (My First cgi.pm Script) (Bart Lateur)
Re: Wanna laugh? (My First cgi.pm Script) <fty@utk.edu>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 17 Apr 1998 11:30:45 GMT
From: Zenin <zenin@archive.rhps.org>
Subject: Re: 'strict' and filehandles
Message-Id: <892813062.38625@thrush.omix.com>
Uwe Hein <heini@cheops.informatik.uni-osnabrueck.de> wrote:
: With 'use strict' I am not able to call
: 'open ( FOO , $filename ) ;' anymore
: (Bareword error).
: Can anyone help?
Post your *exact* code used and the *exact* error message given,
because this should not be a problem when running under strict:
$ perl -Mstrict -wc -e 'open (FOO, ".profile"); close FOO'
-e syntax OK
$
--
-Zenin
zenin@archive.rhps.org
------------------------------
Date: Fri, 17 Apr 1998 11:48:49 GMT
From: John Porter <jdporter@min.net>
Subject: Re: .= so why not =. ?
Message-Id: <35374306.76B0@min.net>
Brad Baxter wrote:
>
> Okay, following is not a perl question, but most FAQ's and books I've read
> make use of the 'foobar' expression. Considering what this stands for, is
> anyone else out there slightly tired of seeing it, as am I? Chances are
> good that if I routinely used profane variable names in my posts, someone
> would call me on it.
>
> Okay, my little rant's over ...
TINAPQ. RTFM.
John Porter
;-)
------------------------------
Date: 17 Apr 1998 13:06:58 +0200
From: JVromans@Squirrel.nl (Johan Vromans)
Subject: Re: Argument checking code in combination with GetOptions
Message-Id: <wl3vhs8g10t.fsf@plume.nl.compuware.com>
Michael Hucka <hucka@eecs.umich.edu> writes:
> which is not very elegant. Seems like there should be a way of writing this
> more compactly in a form such as
Try something like:
my %nono = ( opt_this => [ 'opt_no1', 'opt_no2' ],
opt_that => [ 'opt_nono1', 'opt_nono2' ],
);
my ($k, $v);
while ( ($k,$v) = each ( %nono ) ) {
no strict 'refs';
next unless defined $$k;
foreach my $opt ( @$v ) {
print STDERR ("Options '$k' and '$opt' do not combine\n")
if defined $$opt;
}
}
-- Johan
------------------------------
Date: 17 Apr 1998 11:26:15 GMT
From: Zenin <zenin@archive.rhps.org>
Subject: Re: Argument checking code in combination with GetOptions
Message-Id: <892812791.965122@thrush.omix.com>
Michael Hucka <hucka@eecs.umich.edu> wrote:
: if (defined($opt_host)) {
: if (defined($opt_listhosts) || defined($opt_listpackages)
: || defined($opt_addpackage) || defined($opt_rmpackage)) {
: print "Using both $foo and --host does not make sense.\n";
: &print_usage_and_exit();
: }
: ...
: }
: where $foo is expanded to one of the option names. Problem: is there a way
: of easily setting $foo to the right one (i.e., in this case, "listhosts",
: "listpackages", etc.)?
>snip<
Hmm, how about something like:
if (defined($opt_host)) {
foreach my $foo (qw(opt_listhosts opt_listpackages opt_addpackage opt_rmpackage)) {
no strict 'refs';
if (defined ${"$foo"}) {
print STDERR "Using both --$foo and --host does not make sense.\n";
&print_usage_and_exit();
}
}
}
I personally hate the global var usage of GetOptions() myself.
--
-Zenin
zenin@archive.rhps.org
------------------------------
Date: Fri, 17 Apr 1998 07:16:44 -0400
From: "Grinch" <grinch@whoville.com>
Subject: Re: cgi perl ?
Message-Id: <6h7dhb$ahn@fridge.shore.net>
Abigail wrote in message <6h6aq4$o8h$2@client3.news.psi.net>...
>~arthur (star@sonic.net) wrote on MDCLXXXIX September MCMXCIII in
><URL: news:35369867.7AC0@sonic.net>:
>++ made it executable but how do I make it execute.
>
>
>By telnetting to port 80!
>
>$ telnet www.sonic.net 80
>Trying 208.201.224.21...
>Connected to thunder.sonic.net.
>Escape character is '^]'.
>GET /cgi-bin/star/hiw-?flavor=chocolate HTTP/1.0
>
>HTTP/1.0 200 Document follows
>Date: Fri, 17 Apr 1998 01:17:41 GMT
>Server: NCSA/1.5.2
>Content-type: text/plain
>Content type: text/html
As Abigail has kindly (?) pointed out, telneting to port 80 can be a very
useful debugging tool.
Looking at the above, for example, tells us that your script is executing,
but for some reason is returning two MIME type headers.
Hope this helps!
-grinch
--
-----
"Yes, I'm paranoid, but that doesn't mean
no one's out to get me." - me
Sherm Pendley
grinch@whoville.com
http://www.whoville.com
------------------------------
Date: Fri, 17 Apr 1998 07:27:58 -0400
From: "Grinch" <grinch@whoville.com>
Subject: Re: cgi scripts to modify root-owned files and processes ?
Message-Id: <6h7dne$ap6@fridge.shore.net>
brian d foy wrote in message ...
>In article <6h5f4c$mic$1@nnrp1.dejanews.com>, sweeting@neuronet.com.my
posted:
>
>>I have some CGI scripts to manage DNS ; this involves
>>modifying files owned by root (with 755 privileges) and
>>also involves restarting processes owned by root (with
>>kill -HUP PID).
>
>you really should
>meditate on this issue,
Yes, yes, yes, yes, yes. This _definitely_ should be carefully considered!
>use every scrap of technology available
One such scrap that I would suggest is the web server itself. You can
configure most servers so that they only respond to requests originating
from specific client IP addresses. Although this can be attacked via
spoofing, it's still worthwhile to run a separate "admin" server on a high
port and configure it this way, so that it will only answer requests from
your own workstation. (If you need help doing this, you should post the
question to the appropriate comp.infosystems.www.server.* group, for the
best chance of getting a useful answer.)
Another valuable addition to the security would be to implement some sort of
challenge/response security measure such as MD5 or Kerberos. This would
involve both a server extension and the corresponding browser plugin, but
again, the added security would be well worth the effort.
-grinch
------------------------------
Date: Fri, 17 Apr 1998 10:45:56 GMT
From: Brent Michalski <perlguy@inlink.com>
Subject: Re: cgi using perl
Message-Id: <353732E4.2E5ED560@inlink.com>
try:
print "Content-type: text/html\n\n";
Brent
The FAQs and other pages should answer many of your questions!
------------------------------
Date: Fri, 17 Apr 1998 07:09:56 -0400
From: "Grinch" <grinch@whoville.com>
Subject: Re: cgi using perl
Message-Id: <6h7cfr$9mc@fridge.shore.net>
Yeung Mau Yuen Terence wrote in message <35378788.0@news.chevalier.net>...
>I am a beginner to develop cgi Perl.
...snip...
This isn't really a question about the Perl language. Even though you happen
to be using Perl, your question concerns CGI programming more than the
language itself. You can probably get more (and better) help about this
topic by posting to a more appropriate group, such as
"comp.infosystems.www.authoring.cgi"
You can also find a LOT of help for CGI-related Perl issues at the
following:
<URL: http://reference.perl.com >
HTH!
-grinch
--
-----
"Yes, I'm paranoid, but that doesn't mean
no one's out to get me." - me
Sherm Pendley
grinch@whoville.com
http://www.whoville.com
------------------------------
Date: Fri, 17 Apr 1998 12:47:37 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: CLPM CONTENT POLICE (was info on cookies)
Message-Id: <Pine.A41.3.95a.980417124106.25584F-100000@rsplus07.cern.ch>
On Thu, 16 Apr 1998, Andrew F. Lee wrote:
> In my humble opinion, Perl and CGI are commmon companions.
So you don't believe in usenet's system of dividing groups up into
targetted topics.
> I think that
> CGI questions coming from a Perl programmer ought to be welcome on
> comp.lang.perl.misc
And Perl language questions on c.i.w.authoring.cgi, no doubt.
If a programmer hasn't yet understood the difference between a software
interface and a programming language, the first priority would be to
teach them. Posting to the wrong group is just a symptom rather than
the underlying problem, in many cases.
> My point: If you have something useful to say, please do.
But you hadn't, so you decided to attack the principles of usenet
groups instead.
> If you have
> just had too much caffeine, please refrain from posting pointless and
> sniveling comments (unless they are funny).
Please apply the principles you just stated. I didn't see anything
funny in it.
And you would benefit from a visit to the new user FAQs for hints on
quoting netiquette. [quoted clutter now removed]
------------------------------
Date: Fri, 17 Apr 1998 13:36:10 +0200
From: Jean-Luc Szpyrka <Jean-Luc.Szpyrka@sophia.inria.fr>
Subject: Crypt::IDEA-1.0
Message-Id: <35373EAA.DBC26350@sophia.inria.fr>
Hi,
I'am looking for a binary distribution of the perl module
Crypt::IDEA-1.0 (or for the more complete Cryptix-perl-1.16)
compiled for Windows NT
I tried to compile it without success (using VC++5.0 and
the standard distribution of perl)
(Cryptix can be found at: http://www.systemics.com
Crypt::IDEA is on CPAN)
--------------------------------------------------------------------
Jean-luc.Szpyrka@sophia.inria.fr "Taste is the enemy of Art"
INRIA - 2004 route des lucioles - BP 93 Tel: (33/0) 4 92 38 79 69
06902 SOPHIA-ANTIPOLIS cedex (France) Fax: (33/0) 4 92 38 76 02
------------------------------
Date: Fri, 17 Apr 1998 07:30:56 -0400
From: "Grinch" <grinch@whoville.com>
Subject: Re: Farnham's Freehold
Message-Id: <6h7dno$ap6@fridge.shore.net>
Andrew F. Lee wrote in message ...
>On Thu, 16 Apr 1998, John Porter wrote:
>
>> Ronald Stephens wrote:
>> >
>> > written by Todd Christianson and larry Wall, which I bumped into
>>
>> Nack!
>>
>> s/dd/m/;
>> s/son/sen/;
>>
>> John Porter
>>
>
>s/\bl/L/;
>
s/ich/om/;
------------------------------
Date: Fri, 17 Apr 1998 08:32:02 -0400
From: Bob Trieger <sowmaster@juicepigs.com>
Subject: Re: Farnham's Freehold
Message-Id: <35374BC2.6C76@juicepigs.com>
Grinch wrote:
>
> Andrew F. Lee wrote in message ...
> >On Thu, 16 Apr 1998, John Porter wrote:
> >
> >> Ronald Stephens wrote:
> >> >
> >> > written by Todd Christianson and larry Wall, which I bumped into
> >>
> >> Nack!
> >>
> >> s/dd/m/;
> >> s/son/sen/;
> >>
> >> John Porter
> >>
> >
> >s/\bl/L/;
> >
>
> s/ich/om/;
s/\n/\.\n/;
--
Bob Trieger | Titanic: big boat, bigger
sowmaster@juicepigs.com | iceberg, big deal
------------------------------
Date: Fri, 17 Apr 1998 07:56:06 -0600
From: emmanuel_astier@yahoo.com
Subject: Fork in perl/NT ?
Message-Id: <6h7jh6$lbd$1@nnrp1.dejanews.com>
Hi,
I'm making a HTTP-client in order to test a NT-web-server with a simulation of
100 hits.
I first made the prog on Unix, using a Fork and signals to have the request
sent at the same time.
But the 100 requests saturate our developpement network, so I'd like to have
the same kind of prog localy, on the NT server.
But I don't know what to do with (1) the fork; (2) the signals.
How can I do multiprocess/multithread/multi-whatever with Perl on NT ??
Thanx for any answer...
Emmanuel
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: 17 Apr 1998 13:03:19 GMT
From: "Allan M. Due" <due@discovernet.net>
Subject: Re: Formatting script for Perl5...
Message-Id: <6h7jun$810$0@206.165.146.192>
I think what you are looking for can be found at:
http://reference.perl.com/query.cgi?style
AmD
jeff wrote in message <353537e5.3243279@news.secoast.net>...
>Hi,
>I saw once somewhere a script that would format a perl program. It
>would line up all of the braces, and "beutify" the whole program. Now
>I can't find it, and I have to look through someones code who was
>really sloppy. Where can I find a pre-done script to do this??
>
>Thanks in advance!
>
>Jeff
>jeff@extrapoint.com
------------------------------
Date: Fri, 17 Apr 1998 06:54:55 -0400
From: "James Birchfield" <jsrbirch@toad.net>
Subject: Re: Hash of Arrays
Message-Id: <35373475.0@news6.kcdata.com>
You might alos consider hashing up a reference to the array.
$HASH{$index} = \@array;
Then you can pass the array to a subroutine like this;
foo($HASH{$index});
sub foo {
local($array) = @_;
for(@$array) { ...
}
I like this way better.
Jim
jsrbirch@toad.net
randy wrote in message <353641F3.2EE6F193@surfsouth.com>...
>Ovanes Manucharyan wrote:
>
>> How can I create a hash of Arrays.
>> For example, will this work?
>>
>> @HASH{$index}=@array;
>>
>> Do I need to create this data type? I tried to use this in my code and
>> it only stores the first element of the @array, am I doing something
>> wrong??
>>
>> Thanks is advance.
>>
>> Ovanes
>
> Try this. $HASH{$index} => [ ];
>the brackets [ ] will contain the elements of the array. This is known as
>an anonymous array.
>
------------------------------
Date: Fri, 17 Apr 1998 07:00:50 -0400
From: "Grinch" <grinch@whoville.com>
Subject: Re: Image instead of button in Perl Script
Message-Id: <6h7bus$9g1@fridge.shore.net>
Brad Atkins wrote in message <3536AC74.62E803B8@age.net>...
>I've been trying to get an image instead of a normal form button in a
>web based email client. The problem is, that with certain functions
>(everything except logging in) the Script does not fetch the datum.
>
>Any Suggestions?!
I assume you're using <input type="image" name="whatever">
In this case, the browser doesn't return an input item named "whatever" to
the script when you click on the image. Instead, it returns two name=value
pairs, called "whatever.x" and "whatever.y". They contain the coordinates
that the user clicked upon, relative to the top-left corner of the image.
This isn't strictly a Perl issue, though. This group is intended for
discussion of Perl language issues, such as syntax and module usage. A group
dedicated to CGI issues would have been a better place to post this. I
suggest "comp.infosystems.www.authoring.cgi", especially since most of the
regulars here who are involved with CGI also post there.
HTH!
-grinch
--
-----
"Yes, I'm paranoid, but that doesn't mean
no one's out to get me." - me
Sherm Pendley
grinch@whoville.com
http://www.whoville.com
------------------------------
Date: Fri, 17 Apr 1998 13:57:17 +0200
From: Petter Bergman <petter.bergman@ehpt.com>
Subject: launching external program on W95
Message-Id: <3537439D.4E8C9993@ehpt.com>
Hi,
I am downgrading a build script from UNIX to windows. A fundamental
problem is how to start an external program, e.g. a compiler, from a
perl script. DOS commands work fine, but that's all. Is there a perhaps
a DOS command for running a program?
Regards
Petter
------------------------------
Date: 17 Apr 1998 11:11:29 GMT
From: Zenin <zenin@archive.rhps.org>
Subject: Re: Multi-tasking/threading
Message-Id: <892811905.940362@thrush.omix.com>
Dado Colussi <gdc@xenetic.fi> wrote:
: How about embedding the perl interpreter in a multithreaded
: program and running scripts in several threads at the same
: time?
Sure, but you gain little. The scripts in the different threads
could not share data directly for one thing. If you're looking for
threads for speed (lower priced context switching and all that), you
probably can gain much more speed by optimizing your code
algorithms. On single processor machines, threads don't really help
speed anything up anyway, and under Unix even SMP machines have a
hard time making threads run much faster then processes anyway.
9 out of 10 times, people want threads for the wrong reasons.
Please note I'm being *vary* kind by only saying 9 out of 10...
The *only* reasons I'm looking forward to threads in Perl are for
easier and safer sharing of complex data structures across
multiple threads of execution when dealing with GUI apps and heavy
parsing apps that run on SMP boxes. It's not that the threads are
much or any faster then processes on SMP boxes, but easier sharing
of complex data structures makes coding a small few of my
applications easier and cleaner.
--
-Zenin
zenin@archive.rhps.org
------------------------------
Date: Fri, 17 Apr 1998 07:54:33 -0400
From: "Grinch" <grinch@whoville.com>
Subject: Re: OOPS and several parents
Message-Id: <6h7f3f$c5u@fridge.shore.net>
Tom Christiansen wrote in message <6h4tma$4rr$1@csnews.cs.colorado.edu>...
> [courtesy cc of this posting sent to cited author via email]
>Perhaps the lesson is that multiple inheritance is heretical devilwork.
That's about the only part of this thread that I've been able to
understand... :-)
-grinch
--
-----
"Yes, I'm paranoid, but that doesn't mean
no one's out to get me." - me
Sherm Pendley
grinch@whoville.com
http://www.whoville.com
------------------------------
Date: Fri, 17 Apr 1998 13:56:19 +0200
From: N i c l a s O l o f s s o n <gurun@acc.umu.se>
Subject: Re: PERL aware code editor
Message-Id: <35374363.ABD94FE@acc.umu.se>
> Glenn Schworak wrote:
> > editors developed for PERL that will run under the Windows 95
> > environment.
> > Also, are there any UNIX based programs that can do this by serving
> > ANSI color codes to a telnet session?
Windows: Ultraedit
Unix: vim *evil grin*
/Niclas
------------------------------
Date: 17 Apr 1998 13:17:56 GMT
From: "Allan M. Due" <due@discovernet.net>
Subject: Re: PERL aware code editor
Message-Id: <6h7kq4$9ch$0@206.165.146.192>
Actually the URL is: www.boxersoftware.com/users/dhamel/
WWW.boxwersoftware.com just takes you to his ISP.
I am not sure about Boxer but in UltraEdit you can load your perl code
and then execute the Perl compiler from within UE capturing the output from
the compiler. No multiple open windows. I find this feature very
convenient.
AmD
>UltraEdit is also pretty good, but seemed limited to me compared
>with Boxer.
>
In what ways limited?
------------------------------
Date: 17 Apr 98 12:32:25 GMT
From: "IceStaff" <acidbolt@yahoo.com>
Subject: perl from webpage dont work. perl works local but not as cgi.
Message-Id: <01bd6997$d7be6800$184375c0@spike>
hi
here is some code i took from a webpage that doesent work.
#!/usr/bin/perl -w
use IO::Socket;
unless (@ARGV > 1) { die "usage: $0 host document ..." }
$host = shift(@ARGV);
foreach $document ( @ARGV ) {
$remote = IO::Socket::INET->new( Proto => "tcp",
PeerAddr => $host,
PeerPort => "http(80)",
);
unless ($remote) { die "cannot connect to http daemon on $host" }
$remote->autoflush(1);
print $remote "GET $document HTTP/1.0\n\n";
while ( <$remote> ) { print }
close $remote;
}
and here is code that works local but not as cgi
#!/usr/local/bin/perl
use IO::Socket;
can someone help me with this problems?
i want to know how to send to a ip with a certin port some data.
and resive data.
------------------------------
Date: 17 Apr 1998 12:29:57 GMT
From: orebauad@jmu.edu (shmoo)
Subject: Re: perl script for tacacs
Message-Id: <6h7i05$52f$2@lark.jmu.edu>
In article <Pine.GSO.3.96.980416194411.11254F-100000@user2.teleport.com>, rootbeer@teleport.com says...
>
>On 16 Apr 1998, Angela D. Orebaugh wrote:
>
>> I am writing a perl script to draw reports from the tacacs-accounting
>> file for the dial in service. I need to compile information such as
>> the username, login and logout times, and time accumulated for statistical
>> and billing purposes. Does anyone have any good ideas or suggestions?
>> This is the first real perl scripting I have done.
>
>You should probably get the Llama book (Learning Perl) and read through
>it, doing at least some of the exercises, before you start in on this
>project. Hope this helps!
>
>--
>Tom Phoenix Perl Training and Hacking Esperanto
>Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
yeah thanks, I have already read it though.
>
------------------------------
Date: Fri, 17 Apr 1998 06:59:10 -0400
From: "James Birchfield" <jsrbirch@toad.net>
Subject: Re: PIDs Finding and Killing them from a perl script
Message-Id: <35373580.0@news6.kcdata.com>
You can try 'kill -TERM $pid'.
James Birchfield
Michael Shavel wrote in message ...
>Hi
>
>
>I have a perl script calling a csh script which then in turns calls an
>sqrt statement on a Sybase database.
>
>I need the ability to kill the process I started from the perl script but
>I am having problems getting the correct PID to kill.
>
>First off here is the short subroutine I use in the perl script:
>
>$c = "some_script_for_cshell.csh";
>
>$pid_num = execute_and_get_pid($c);
>sub execute_and_get_pid
>{
> my ($report) = @_;
> $pid = open(RUN,"|$report");
> return $pid;
> close (RUN);
>}
>
>What is returned to me in $pid is the PID of the csh script. I find that if
I
>kill this PID (kill -9 $pid), It does not kill any children that the csh
>script spawned (I can see this by doing several ps -ef's). So anything the
>csh script might have called is still alive and running.
>
>Questions:
>1.Is there a specific option to"kill" that will kill the parent and
>all of it's children?
>
>2. If the answer to #1 is no, is there a way for me to get the PID's of the
>children that are spawned? (I tried using ps -ef |grep and then parsed
>out the PID from the string returned but this seems error prone and not
>exact)
>
>I tried to fork() and exec() myself but still get the same PID's back.
>
>The reason for all of this is that it is part of a larger perl/tk script
>that is used to kick off a number of other scripts and each of those
>scripts in turn run sqr statements from Sybase. I need to build in the
>option to kill any of those queries in the event the user called the wrong
>one (some take hours to run).
>
>I posted a variation to this question a few weeks ago. Sorry if this is
>repetition for anyone.
>
>I would very much appreciate any help and/or suggestions. I have tried
>every way I can think of, I'm just about out of ideas.
>
>Thanks
>
>Mike Shavel
>mshavel@erols.com
------------------------------
Date: 17 Apr 98 11:28:32 GMT
From: "James Richardson" <jamesr@aethos.co.uk.nospam>
Subject: Re: PIDs Finding and Killing them from a perl script
Message-Id: <01bd69f5$595fda80$26c0a4c1@kitkat.aethos.co.uk>
Michael Shavel <mshavel@erols.com> wrote in article
<mshavel-1604981937180001@130.9.16.207>...
> Hi
[blah]
> Questions:
> 1.Is there a specific option to"kill" that will kill the parent and
> all of it's children?
Well, I dont know about Perl in this instance, but my kill(1) manpage says:
pid is a process identifier, an unsigned or negative integer that can
be one of the following:
[...]
<-1 All processes, except special system processes, whose
process group ID is equal to the absolute value of pid and
whose real or effective user ID is the same as the user of
the sending process.
Maybe this will work....
James
------------------------------
Date: Fri, 17 Apr 1998 06:45:56 -0400
From: "Grinch" <grinch@whoville.com>
Subject: Re: Profane foobar? (was: Re: .= so why not =. ?)
Message-Id: <6h7b3p$96s@fridge.shore.net>
Tom Phoenix wrote in message ...
>Actually, 'foobar' is the variant (sanitized?) form of 'fubar', to me. And
>(to me) 'fubar' stands for "Fouled Up Beyond All Recognition". Nothing
>profane there, or maybe I just lack a dirty mind. :-)
It's certainly profane in the eyes of the USAF. I was once threatened with a
court martial for including the phrase "fubar" in error messages.
Fortunately it didn't stick. But, I had to spend my first day of terminal
leave "sanitizing" and recompiling all of the programs involved, under the
watchful eyes of the squadron security officer. And, the civilian
contractors who'd said that a job was a "sure thing" once I was discharged,
suddenly wouldn't talk to me.
Everything eventually worked out for the better, but it certainly left an
impression. I've never used the term "fubar" in a program again, and rarely
use "foo," "bar," or "baz," either... :-)
-grinch
--
-----
"Yes, I'm paranoid, but that doesn't mean
no one's out to get me." - me
Sherm Pendley
grinch@whoville.com
http://www.whoville.com
------------------------------
Date: Fri, 17 Apr 1998 12:26:10 +0200
From: Michel Carpentier <mca@ambrasoft.lu>
To: Grace Cheng <gcheng@corp.sgi.com>
Subject: Re: Recursive Calls in Perl ?
Message-Id: <35372E42.4239@ambrasoft.lu>
Grace Cheng wrote:
>
> Hi,
>
> Is it possible to do 'recursion' in Perl ?
>
> The manul says the "Subroutines may be called recursively"
> but I couldn't seem to get it to work.
Hi,
Yes, it works. But you have to take care to the variables.
You have to use 'local' or 'my' variables for the recursion.
Try this example :
#!/usr/bin/perl
$res = fact(5);
print $res;
sub fact()
{
my $a = $_[0];
print "$a\n";
if ($a == 1)
{
return 1;
}
else
{
$a = $a * &fact($a-1);
return $a;
}
}
mca@ambrasoft.lu
------------------------------
Date: Fri, 17 Apr 1998 12:12:58 GMT
From: John Porter <jdporter@min.net>
Subject: Re: Wanna laugh? (My First cgi.pm Script)
Message-Id: <353748B0.5FFD@min.net>
Craig Berry wrote:
>
> TANSTAAFL. FNORD. :)
What do these stand for?
TINGRFCALIAS!
John Porter
------------------------------
Date: Fri, 17 Apr 1998 12:04:33 GMT
From: bart.mediamind@tornado.be (Bart Lateur)
Subject: Re: Wanna laugh? (My First cgi.pm Script)
Message-Id: <35374099.1124699@news.tornado.be>
Craig Berry wrote:
>Mark-Jason Dominus (mjd@op.net) wrote:
>: Maybe you meant
>:
>: print while <HEADER>;
>
>That works too, but is (a little bit) slower.
Does it? I thought the "assign to $_" magic ONLY works in
while(<HANDLE>) { ...}
(HANDLE optional).
Let's try it.
open(HANDLE,shift) or die "Can't open file, $!";
$_ = "Haha, fooled you!\n";
print while <HANDLE>;
That's strange. It DOES work. To make sure I'm not making any dumb
mistakes, I tried this variation, with the same result.
print $_ while <HANDLE>;
Is this behaviour in the docs? I can't find it.
Bart.
------------------------------
Date: Fri, 17 Apr 1998 09:13:15 -0400
From: Jay Flaherty <fty@utk.edu>
To: Darryl Lee <lee@spam-me-not-darryl.com>
Subject: Re: Wanna laugh? (My First cgi.pm Script)
Message-Id: <3537556A.8C9ABDC3@utk.edu>
Darryl Lee wrote:
> Well, i went and took a crudely crafted plain ole perl CGI, and made
> it into a crudely crafted cgi.pm CGI.
>
> And why yes, this is a troll for pointers on optimizing my code.
> Basically, i got it to run, and it's ugly as heck, and i'm JAPHW
> (Just Another Perl Hacker Wannabe), but i'm willing to take my lumps
> if you can teach me something.
Some generalities:
1. Trap warnings with the -w switch on the hashbang line (i.e.
#!/usr/local/bin/perl5 -w)
What this will trap are use of undefined values, non-numeric arguments, "="
instead of "==", and many more (see every entry labeled (W) in chap. 9 of
Programming Perl.
2. use the strict pragma. This will restrict unsafe constructs.There are three
things to be strict about:
a. strict 'refs' - prevents you from using symbolic references
b. strict 'vars' - forces you to declare your variables via my(), fully
qualify them, or
import them.
c. strict 'subs' - gives you an error if you use a bareword identifier that
is not a
predeclared subroutine.
3. Check for return values. Not every open(), fork(), or exec() succeeds. check
to see if they do and print an error message when they fail.
4. It is a good idea to check for tainted variables when programming CGI
scripts. (i.e use the -T switch on the hashbang line, or use the Safe module).
It forces you to validate every piece of user-supplied data with regular
expressions before you use them.
[these caveats were gleaned from the excellent article:
"Perfect Programming" - by Nathan Torkington (The Perl Journal - vol.2 No. 3)]
Jay
------------------------------
Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Mar 97)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V8 Issue 2347
**************************************