[16517] in Perl-Users-Digest
Perl-Users Digest, Issue: 3929 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Aug 6 14:10:31 2000
Date: Sun, 6 Aug 2000 11:10:16 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <965585416-v9-i3929@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Sun, 6 Aug 2000 Volume: 9 Number: 3929
Today's topics:
Re: Perl Newbie Question (Colin Keith)
Re: Perl Newbie Question <flavell@mail.cern.ch>
Re: Perl Newbie Question <joelnelson@home.net>
Re: Programming Ethics (Keith Calvert Ivey)
Re: Programming Ethics <ereppert@rochester.rr.com>
Re: reading and writing to dmb file ( .db) <gellyfish@gellyfish.com>
Re: reading and writing to dmb file ( .db) (Keith Calvert Ivey)
Re: reading and writing to dmb file ( .db) drdementor@my-deja.com
Re: reading and writing to dmb file ( .db) drdementor@my-deja.com
Re: reading and writing to dmb file ( .db) <flavell@mail.cern.ch>
Re: reading and writing to dmb file ( .db) drdementor@my-deja.com
Re: Someone please explain the 'my' declaration. <jaford@watford53.freeserve.co.uk>
Re: Someone please explain the 'my' declaration. (Colin Keith)
Re: Stumped Again! (Pete Holsberg)
Re: suidperl - /bin/ps is not secure for setuid operati <gellyfish@gellyfish.com>
Re: syslog on win32? <gellyfish@gellyfish.com>
Re: web based emails [humor] <robert99@maine.rr.nodamnspam.com>
Re: web based emails (Keith Calvert Ivey)
Will "stop" stop the perl-script? <robert99@maine.rr.nodamnspam.com>
Re: Will "stop" stop the perl-script? <tony_curtis32@yahoo.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sun, 06 Aug 2000 16:33:40 GMT
From: newsgroups@ckeith.clara.net (Colin Keith)
Subject: Re: Perl Newbie Question
Message-Id: <Ergj5.78$DT4.2744116@nnrp2.clara.net>
In article <GW5j5.1809$KO2.41028@typhoon.austin.rr.com>, "Ken" <research@ev1.net> wrote:
>given when I `print @data` I get the format I'm looking for, but the join
>doesn't append to the file. What would I need to append to the file once
>the join has occurred?
*blinky blink* urm, "join doesn't append to the file" ?
It doesn't do any writing back to the file, just open the file for
read/write access. Read in your line, split it into the array and fiddle.
(What you have already) then just write it back to the file. Since you
want to overwrite what's there (practice on a *copy* of the data:-) you'll
need to rewind to the beginning of the file, zap what's there and then print
your copy back out.
print FH join('|', @data) if(seek(FH, 0, 0) && truncate(FH, 0));
close(FH);
Oh, and of course, you'll now need to open your file using:
open(FH, '+<myfile.dat') || die "can't open - $!";
or if using sysopen:
sysopen(FH, 'myfile.dat', O_RDWR|O_CREAT|O_EXCL, 0655) || die " .. $!";
Btw, if you're reading lots of lines like this, its probably easier to write
the newly formatted data to another file which you opened for writing.
print OtherFH join('|', @data);
Otherwise, keep appending the array you generate for each line to another
array and then output that at the end.
And why does everyone want to use pipes for field separators? Whatever
happened to colons or good old fashioned csv's ? :)
---
Colin Keith
Systems Administrator
Network Operations Team
ClaraNET (UK) Ltd. NOC
------------------------------
Date: Sun, 6 Aug 2000 18:50:23 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Perl Newbie Question
Message-Id: <Pine.GHP.4.21.0008061846000.25484-100000@hpplus03.cern.ch>
On Sun, 6 Aug 2000, Colin Keith wrote:
> And why does everyone want to use pipes for field separators?
Because they anticipate that the fields might contain colons or
commas, and they don't want the overhead of implementing an escape
mechanism?
> Whatever happened to colons or good old fashioned csv's ? :)
I tend to drift towards TABs, myself. But I won't claim there's
one correct answer. Some people use \0 , though probably not if they
have any kind of background in C ;-) (Back in EBCDIC days we used
a control character called a field mark.)
------------------------------
Date: Sun, 06 Aug 2000 17:25:23 GMT
From: Joel Nelson <joelnelson@home.net>
Subject: Re: Perl Newbie Question
Message-Id: <398D9F61.C09C7B1@home.net>
Ken wrote:
> while (<FILEHANDLER>) {
> @data = split(/\|/);
> @data = join("|",
> $data[0],$data[1],
> $datestr1, $data[2], $data[3], $data[4], $data[5],
> $datestr2, $data[6] , $data[7], $data[8], $data[9],
> $datestr3, $data[10], $data[11], $data[12], $data[13],
> $datestr4, $data[14], $data[15], $data[16] ,$data[17],
> $datestr5, $data[18], $data[19], $data[20], $data[21],
> $datestr6, $data[22], $data[23], $data[24], $data[25],
> $datestr7, $data[26], $data[27], $data[28], $data[29],
> );
> given when I `print @data` I get the format I'm looking for, but the join
> doesn't append to the file. What would I need to append to the file once
> the join has occurred?
Hmmm,
If the data file is not too big you could use this psuedo code:
open (FILEHANDLER,"<$datafile");
@fileContents = <FILEHANDLER>;
close (FILEHANDLER);
for ($i=0; $i<@fileContents; $i++) {
@record = split(/\|/,$fileContents[$i]);
'splice in your new data here'
$fileContents[$i] = @record;
}
open (FILEHANDLER,">$datafile");
print FILEHANDLER @fileContents;
close (FILEHANDLER);
Of course you may want to create file backups before rewriting the file in case
something goes wrong. And don't forget error checking.
Joel
------------------------------
Date: Sun, 06 Aug 2000 14:08:55 GMT
From: kcivey@cpcug.org (Keith Calvert Ivey)
Subject: Re: Programming Ethics
Message-Id: <398e7040.1699335@news.newsguy.com>
Jason Maggard <jmaggard@va.mediaone.net> wrote:
>If you hadn't programmed this someone else would have.
>If someone else wouldn't have they could buy one.
If you hadn't agreed to kill his wife, someone else would have.
If someone else wouldn't, he would have done it himself.
Now, you may not agree that spamming is wrong (and even I don't
think it's in the same league as murder). But if something is
wrong, the fact that someone else might do it doesn't change
it's wrongness.
>The ethics of this really are not your concern, as programmers,
>we supply information and methods of dealing with it.
"Once ze rockets go up, who cares vhere zey come down? Zat's
not my department, says Wernher von Braun."
--
Keith C. Ivey <kcivey@cpcug.org>
Washington, DC
------------------------------
Date: Sun, 06 Aug 2000 16:40:43 GMT
From: Ed Reppert <ereppert@rochester.rr.com>
Subject: Re: Programming Ethics
Message-Id: <ereppert-08FCBF.12422106082000@news-server.rochester.rr.com>
In article <398D1351.D8A14436@va.mediaone.net>, Jason Maggard
<jmaggard@va.mediaone.net> wrote:
> If you hadn't programmed this someone else would have.
> If someone else wouldn't have they could buy one.
>
> The ethics of this really are not your concern, as programmers, we
> supply
> information and methods of dealing with it. What they choose to do with
> that information is as ethereal as what I will choose to do upon
> recieving
> their spam....
"I vas only following orders..."
------------------------------
Date: 6 Aug 2000 15:06:14 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: reading and writing to dmb file ( .db)
Message-Id: <8mjrcm$78c$1@orpheus.gellyfish.com>
On Sun, 06 Aug 2000 09:25:25 GMT drdementor@my-deja.com wrote:
>
>
> Im a little new tp perl but experienced programmer...
>
> Picking up the perl very fast...
> I wanted to store a hash to a file.
>
> I got this code from the book, it doenst work....
>
> use Fctl;
> use NDBM_File;
> tie %hash, "NDBM_File" , 'data' . O_RDWR|O_CREAT|O_EXCL , 0644;
> $hash{drink} = 'root beer';
> untie $hash;
>
> thats the code, its supposed to make file data.db and put the hash into
> it. I am getting errors.
>
> error....################################## start #############Illegal
> modulus of constant zero in file write_to_database.cgi at line 61, next
> 2 tokens "file_hash;"
> Execution of write_to_database.cgi aborted due to compilation errors.
> error....#################################end #######################
>
Old version of Perl. Print out $] in your program to determine what
version it is.
/J\
--
yapc::Europe in assocation with the Institute Of Contemporary Arts
<http://www.yapc.org/Europe/> <http://www.ica.org.uk>
------------------------------
Date: Sun, 06 Aug 2000 14:40:18 GMT
From: kcivey@cpcug.org (Keith Calvert Ivey)
Subject: Re: reading and writing to dmb file ( .db)
Message-Id: <39927842.3749958@news.newsguy.com>
drdementor@my-deja.com wrote:
>modulus of constant zero in file write_to_database.cgi at line 61, next
>2 tokens "file_hash;"
>Execution of write_to_database.cgi aborted due to compilation errors.
Well, how about showing us the bit around line 61 in
write_to_database.cgi, and indicating which line is 61?
The bit you posted didn't have any mention of file_hash.
Be sure to copy and paste rather than retyping, especially
since it sounds like you have a syntax error.
--
Keith C. Ivey <kcivey@cpcug.org>
Washington, DC
------------------------------
Date: Sun, 06 Aug 2000 16:05:18 GMT
From: drdementor@my-deja.com
Subject: Re: reading and writing to dmb file ( .db)
Message-Id: <8mk2bs$d5s$1@nnrp1.deja.com>
In article <39927842.3749958@news.newsguy.com>,
kcivey@cpcug.org (Keith Calvert Ivey) wrote:
> drdementor@my-deja.com wrote:
>
> >modulus of constant zero in file write_to_database.cgi at line 61,
next
> >2 tokens "file_hash;"
> >Execution of write_to_database.cgi aborted due to compilation errors.
>
use Fctl;
use NDBM_File;
tie %hash, "NDBM_File" , 'data' . O_RDWR|O_CREAT|O_EXCL , 0644; $hash
{drink} = 'root beer';(57)
untie $hash;(61)
im not going to include the entire program its jsut a bunch of pascing
and print statements that i already teasted and that part is bullet
proof. the code i posted here, i inserted into my program, from a book
published in late 99, copied verbatum...
sorry for the confusion.. oh the hash was not declaired anywhere sle in
the program, files not worked with any other place than here, its all
independent code, i just figured someone would see something obviously
wring with it possibly.
is this old code as someone else said? if so is it backwards compatable?
also whats the new way to set up this file now?
I just want to write a hatch or possibly multidimentional array to a
file, i thought this is how it was supposed to be done..
thats the code, its supposed to make file data.db and put the hash into
it. I am getting errors.
error....################################## start #############Illegal
modulus of constant zero in file write_to_database.cgi at line 61, next
2 tokens "file_hash;"
Execution of write_to_database.cgi aborted due to compilation errors.
error....#################################end #######################
> Well, how about showing us the bit around line 61 in
> write_to_database.cgi, and indicating which line is 61?
> The bit you posted didn't have any mention of file_hash.
> Be sure to copy and paste rather than retyping, especially
> since it sounds like you have a syntax error.
>
> --
> Keith C. Ivey <kcivey@cpcug.org>
> Washington, DC
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Sun, 06 Aug 2000 16:08:21 GMT
From: drdementor@my-deja.com
Subject: Re: reading and writing to dmb file ( .db)
Message-Id: <8mk2hj$ddp$1@nnrp1.deja.com>
In article <8mjrcm$78c$1@orpheus.gellyfish.com>,
Jonathan Stowe <gellyfish@gellyfish.com> wrote:
> On Sun, 06 Aug 2000 09:25:25 GMT drdementor@my-deja.com wrote:
> >
> >
> > Im a little new tp perl but experienced programmer...
> >
> > Picking up the perl very fast...
> > I wanted to store a hash to a file.
> >
> > I got this code from the book, it doenst work....
> >
> > use Fctl;
> > use NDBM_File;
> > tie %hash, "NDBM_File" , 'data' . O_RDWR|O_CREAT|O_EXCL , 0644;
> > $hash{drink} = 'root beer';
> > untie $hash;
> >
> > thats the code, its supposed to make file data.db and put the hash
into
> > it. I am getting errors.
> >
> > error....################################## start
#############Illegal
> > modulus of constant zero in file write_to_database.cgi at line 61,
next
> > 2 tokens "file_hash;"
> > Execution of write_to_database.cgi aborted due to compilation
errors.
> > error....#################################end
#######################
> >
>
> Old version of Perl. Print out $] in your program to determine what
> version it is.
are you saying the code is old or the perl on the server is old?
whats the other way of doing it if you believe either is the case, i
dont have access to webbaised database right now, like my sql etc...
of can i just throw mysql in my cgi bin? i dont think you can thats not
my impression of it, but i will ask just in case
Jim
>
> /J\
> --
> yapc::Europe in assocation with the Institute Of Contemporary Arts
> <http://www.yapc.org/Europe/> <http://www.ica.org.uk>
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Sun, 6 Aug 2000 18:37:06 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: reading and writing to dmb file ( .db)
Message-Id: <Pine.GHP.4.21.0008061825210.25484-100000@hpplus03.cern.ch>
On Sun, 6 Aug 2000 drdementor@my-deja.com wrote:
> In article <8mjrcm$78c$1@orpheus.gellyfish.com>,
> Jonathan Stowe <gellyfish@gellyfish.com> wrote:
[excessive quotage now omitted]
> > Old version of Perl. Print out $] in your program to determine what
> > version it is.
>
> are you saying the code is old or the perl on the server is old?
gellyfish is saying "Print out $] in your program to determine what
version it is". (And report the answer here, of course.)
A quick glance in the Perl documentation would show you what $]
stands for, since you evidently don't yet know. It's in perldoc
perlvar, if you're still so unfamiliar with the documentation that you
don't know where to look.
You've now wasted another pointless round of discussion, and decreased
the chance of getting helped. I really don't know why so many newbies
approach usenet in this self-destructive way.
------------------------------
Date: Sun, 06 Aug 2000 17:29:45 GMT
From: drdementor@my-deja.com
Subject: Re: reading and writing to dmb file ( .db)
Message-Id: <8mk7a5$ggs$1@nnrp1.deja.com>
In article <Pine.GHP.4.21.0008061825210.25484-100000@hpplus03.cern.ch>,
"Alan J. Flavell" <flavell@mail.cern.ch> wrote:
> On Sun, 6 Aug 2000 drdementor@my-deja.com wrote:
>
> > In article <8mjrcm$78c$1@orpheus.gellyfish.com>,
> > Jonathan Stowe <gellyfish@gellyfish.com> wrote:
>
> [excessive quotage now omitted]
>
> > > Old version of Perl. Print out $] in your program to determine
what
> > > version it is.
> >
> > are you saying the code is old or the perl on the server is old?
>
> gellyfish is saying "Print out $] in your program to determine what
> version it is". (And report the answer here, of course.)
>
> A quick glance in the Perl documentation would show you what $]
> stands for, since you evidently don't yet know. It's in perldoc
> perlvar, if you're still so unfamiliar with the documentation that you
> don't know where to look.
>
> You've now wasted another pointless round of discussion, and decreased
> the chance of getting helped. I really don't know why so many newbies
> approach usenet in this self-destructive way.
>
>
i wasnt able to acess the surver last night im having interent
difficulties. It took me 20 min just to get that line of code in my
program...i did it just now, im using aol and they are not doing well
in my area right now,, i know they are not good but i connect faster
than my friends and i have a piece of poop machine, but i suppose
conection speed isnt everything...
version of perl
$RCSfile: perl.c,v
$$Revision: 4.0.1.8
$$Date: 1993/02/05 19:39:30
$ Patch level: 36
perl 5 should be out by now... so i think anyways.
so is this the problem?
i simply asked in the prior postings what the old version of doing this
is, i jsut need comand anme then i can use the help somewhere. Perl
help seems to be lacking on the web compaired to ms c++ and vb (not big
vb fan)
btw if im wasting yoru time dont respond to me with your arrogent
talk... your messing up the board more than me. watch out i might be
your boss some day, you dont know who I am. your self rightous attitude
tells me that in your life programming is probably the only thing you
do well. Dont take your insecurities out on me or respond ot this post,
im wasting your time reading it, so who would you waste your time
replying. I am sure you will waste more time responding though, you
cant help ouself..
Jim
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Sun, 06 Aug 2000 15:23:27 +0100
From: Jim Ford <jaford@watford53.freeserve.co.uk>
To: Walt Mankowski <waltman@netaxs.com>
Subject: Re: Someone please explain the 'my' declaration.
Message-Id: <398D74DF.81C34060@watford53.freeserve.co.uk>
Walt Mankowski wrote:
> You might also want to read Mark-Jason Dominus' article "Coping With
> Scoping". It originally appeared in The Perl Journal, and is available
> online at http://www.plover.com/~mjd/perl/FAQs/Namespaces.html
>
> Walt
Excellent - looks just what I was looking for!
Thanks to all who replied.
Regards: Jim Ford
------------------------------
Date: Sun, 06 Aug 2000 17:46:06 GMT
From: newsgroups@ckeith.clara.net (Colin Keith)
Subject: Re: Someone please explain the 'my' declaration.
Message-Id: <yvhj5.79$DT4.2751531@nnrp2.clara.net>
In article <398C276E.8D6BF55C@watford53.freeserve.co.uk>, Jim Ford <jaford@watford53.freeserve.co.uk> wrote:
>perldocs tell me 'lexically scopes' the variable. I'm not very clear on
>what this means and would be grateful if somebody could explain it more
>clearly, please!
Basically it restrains it to the scope - the block - within which it is
defined. Outside of that scope, it doesn't exist. This is unlike variables
defined as local() which are just local (temporary) changes to a
package variable. Thus in:
maia% perl -w
{
my($var) = 1;
print "var = $var\n";
}
print "var = $var\n";
You get:
Name "main::var" used only once: possible typo at - line 6.
var = 1
Use of uninitialized value at - line 6.
var =
In otherwords, $var was defined within the scope of the { }'s and not known
outside of it. So that's the scope. Obviously this can be bigger, an
if/else/etc block, a loop, or even the entire file:
#!/usr/bin/perl -w
my($var) = 'bob';
But nothing from outside of that scope can access the variable. I.e. if you
have a variable that's a package variable - one that can be accessed by
$main::var; then you can make a local change to it like this:
local($var) = 'bob2';
And if you do that within a block it will only change it within that block.
But since it is changing the *package* variable, a fully qualified variable
name will get that current value of the variable when within that block, but
as soon as the block ends, it will get the original value. I.e.
#!/usr/bin/perl -w
local($var) = 'bob';
print "var = $main::var\n";
{
local($var) = 'bob2';
print "var = $main::var\n";
}
print "var = $main::var\n";
This is particularly useful for variables which are package variables, but
that you want to change for a moment. For instance the warnings variable
(whether -w is on or not) can be turned off when you're doing something
highly dodgy to prevent it generating warnings. If you don't specify that
its a local() change, then you change the value of the variable completely,
I.e.
maia% perl -w -Mstrict;
print "Warning state: $^W\n";
{
$^W = 0;
# do something dodgy
}
print "Warning state: $^W\n";
Warning state: 1
Warning state: 0
But if you declare it as a local change:
maia% perl -w -Mstrict;
print "Warning state: $^W\n";
{
local($^W) = 0;
# do something dodgy
}
print "Warning state: $^W\n";
Warning state: 1
Warning state: 1
In otherwords you temporarily changed the value of ^W in the
package main ($main::^W). Note also that my()'ed variables are not available
to subroutines, but local() are. So
maia% perl -w
sub printx{ print "x = $x\n"; };
{
my($x) = 10;
printx();
}
{
local($x) = 10;
printx();
}
Use of uninitialized value at - line 1.
x =
x = 10
Now, you have to scoot yerself over to perlsub and perlref and read away
before anyone kills me for making long winded posts and probably not
explaining things well (errors/critism welcome, sports fans). Hopefully
that's helped, though it felt like trying to define the word 'between'
(remember, you can't use the word in its definition :-)
- I have a bug! Its walking across my desk at the moment :)
---
Colin Keith
Systems Administrator
Network Operations Team
ClaraNET (UK) Ltd. NOC
------------------------------
Date: 6 Aug 2000 15:34:29 GMT
From: pjh@mccc.edu (Pete Holsberg)
Subject: Re: Stumped Again!
Message-Id: <8mk0i5$r3s$1@lawrenceville.mccc.edu>
Thanks for all your suggestions. I learned a lot from them.
Pete
------------------------------
Date: 6 Aug 2000 15:18:18 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: suidperl - /bin/ps is not secure for setuid operation
Message-Id: <8mjs3a$9js$1@orpheus.gellyfish.com>
On Fri, 04 Aug 2000 21:37:19 GMT gary_griffith@hotmail.com wrote:
> Can anyone tell me why this gives the error: "This /bin/ps is not
> secure for setuid operation."? How do I get /bin/ps to run with
> suidperl?
>
put :
$< = $> ;
at the beginning of the program. Also read the perlsec manpage.
/J\
--
yapc::Europe in assocation with the Institute Of Contemporary Arts
<http://www.yapc.org/Europe/> <http://www.ica.org.uk>
------------------------------
Date: 6 Aug 2000 14:54:16 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: syslog on win32?
Message-Id: <8mjqm8$4sh$1@orpheus.gellyfish.com>
On Fri, 4 Aug 2000 23:14:22 +0800 news.wiredcity.com.au wrote:
> Hi
>
> I am running a syslog deamon on a win2k box that logs all entires to ODBC. I
> have some admin scripts that generate logs and I'd like to have them logged
> to the syslog server as well so that they go to the database as well.
>
> I'm using the latest build of perl from Activestate but the sys::syslog
> module seems to be unix only.
>
> Is there a module or library available that allows a perl script running on
> Win32 to log to a syslog server?
>
I dont see any reason why you shouldn't be able to use Sys::Syslog on
windows - except for the fact that it uses an XS component in the latest
version. You should be able to work out how to do it yourself by looking
at the code though.
/J\
--
yapc::Europe in assocation with the Institute Of Contemporary Arts
<http://www.yapc.org/Europe/> <http://www.ica.org.uk>
------------------------------
Date: Sun, 6 Aug 2000 10:25:22 -0400
From: "Robert Lee" <robert99@maine.rr.nodamnspam.com>
Subject: Re: web based emails [humor]
Message-Id: <xzej5.30810$9E6.181992@newsr1.maine.rr.com>
Sounds like your writing carnivore :o)
You don't work for the FBI do you?
-Robert
------------------------------
Date: Sun, 06 Aug 2000 14:30:32 GMT
From: kcivey@cpcug.org (Keith Calvert Ivey)
Subject: Re: web based emails
Message-Id: <39907597.3067068@news.newsguy.com>
"Gilly" <trbovidd@mcmaster.ca> wrote:
>I have been working on my own parser of emails for our system (our own
>little version of procmail, if you will) and it is accepting mails
>originating from our machine and in school, yet mails from hotmail, yahoo,
>etc are not coming in. Does someone here know how these emails are
>formatted? ie do they have different headers that other emails? I have a
>regular expression in perl set up to search for the line containing "To: ".
>Much thanks for your time and assistance in this.
If you want help, you might want to post the relevant section of
your code. When you say that e-mail from Yahoo and Hotmail is
not coming in, do you mean you're unable to POP them off the
server? If so, that has nothing to do with the format. If not,
why don't you just print one of the messages after you've
retrieved it and then look at the format to see what you're
doing wrong?
--
Keith C. Ivey <kcivey@cpcug.org>
Washington, DC
------------------------------
Date: Sun, 6 Aug 2000 12:21:16 -0400
From: "Robert Lee" <robert99@maine.rr.nodamnspam.com>
Subject: Will "stop" stop the perl-script?
Message-Id: <aggj5.30813$9E6.182219@newsr1.maine.rr.com>
If a user hits the Stop button on their browser during a request, will that
stop a Perl script from executing without finishing? I was wondering because
I'm planning on writing a forum and in my post.pl file, several other files
will need to be modified and/or created. If the user hits Stop on their
browser after hitting Submit I need to be sure that none of those files can
become damaged on account of an unfinished script.
Thanks,
Robert
------------------------------
Date: 06 Aug 2000 11:29:08 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: Will "stop" stop the perl-script?
Message-Id: <87itte8iaz.fsf@limey.hpcc.uh.edu>
>> On Sun, 6 Aug 2000 12:21:16 -0400,
>> "Robert Lee" <robert99@maine.rr.nodamnspam.com> said:
> If a user hits the Stop button on their browser during a
> request, will that stop a Perl script from executing
> without finishing? I was wondering because I'm planning
> on writing a forum and in my post.pl file, several other
> files will need to be modified and/or created. If the
> user hits Stop on their browser after hitting Submit I
> need to be sure that none of those files can become
> damaged on account of an unfinished script.
This isn't really a perl question. Try asking your
question again to yourself but say "shell script" instead.
I'd suggest this is more on topic in a cgi newsgroup.
You'd also need to know what your webserver does in this
situation.
[ It's possible that your program will get a SIGPIPE the
first time it tries to output back to the requesting
client after the connection has gone away. So you need to
know how to handle signals in perl. ]
But you need to find out what applies in your situation
first. Everything above is just speculation to point to
the correct info.
hth
t
--
"With $10,000, we'd be millionaires!"
Homer Simpson
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V9 Issue 3929
**************************************