Re: RE: RE: Perl 5.8 IIS 5.0 hangs on script failure

2004-01-08 Thread desarrollo
It just return the error to the browser. Can't locate drive://dir/file.ext in @INC 
But, when I dont use eval PerlIS crashes and that is not normal.


- Mensaje Original -
Fecha: 08/Ene/2004 04:36:05 PM
De: [EMAIL PROTECTED]
Para: [EMAIL PROTECTED], [EMAIL PROTECTED] 
Asunto: RE: RE: Perl 5.8 IIS 5.0 hangs on script failure

What happens if you enclose the require in an eval{} block?

Peter Guzis
Web Administrator, Sr.
ENCAD, Inc.
- A Kodak Company
email: [EMAIL PROTECTED]
www.encad.com 

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Thursday, January 08, 2004 4:32 PM
To: Peter Guzis; [EMAIL PROTECTED]
Subject: Re: RE: Perl 5.8 IIS 5.0 hangs on script failure




- Mensaje Original -
Fecha: 08/Ene/2004 03:28:11 PM
De: [EMAIL PROTECTED]
Para: [EMAIL PROTECTED] 
Asunto: RE: Perl 5.8 IIS 5.0 hangs on script failure

What are you trying to require?

Nothing in particular...
Just that when I use ''require'' and call an external script and for some reason I
misstype the name of the external script, then instead of getting the error printed
, Perl hangs and I have to restart IIS in order to make it work again.



Peter Guzis
Web Administrator, Sr.
ENCAD, Inc.
- A Kodak Company
email: [EMAIL PROTECTED]
www.encad.com 

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Thursday, January 08, 2004 3:13 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: Perl 5.8 IIS 5.0 hangs on script failure


what is the exact build number for ActivePerl? the latest is 808. Also, 
does this occur on any script ie something as simple as:

# start code
use strict;
use CGI;

my $page = new CGI;

# print header and start the markup output

print $page-header( ''text/html'' );
print $page-start_html( ''hello from perl cgi!'' );
print $page-h2(''hello dave...'');
print $page-end_html;

# end code

Build is 808. At the time this occurs only when using ''require'', which I use 
a 
lot.


it also looks like you are using ISAPI - does this only occur with ISAPI 
or is perl.exe causing problems as well?

Yes, this happens only when using PerlIS (Perl ISAPI)

By now I have turned off ISAPI and went back to Perl.exe. But I would really like

to know what is the reason why PerlIS behaves like this in this version of Perl.

If someone has the answer please let me know.

Thanks in advance
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs






___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: RE: RE: Perl 5.8 IIS 5.0 hangs on script failure

2004-01-08 Thread Peter Guzis
Hmm.  Perhaps it is permissions-related.  As a test, can you try just opening the 
required file for read access?

### example script (bare minimum)

open (IN, path/to/file) or die Could not read file: $!\n;

###

If this doesn't shed any light, perhaps you should post the first few lines of your 
script verbatim. 

Peter Guzis
Web Administrator, Sr.
ENCAD, Inc.
- A Kodak Company
email: [EMAIL PROTECTED]
www.encad.com 

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Thursday, January 08, 2004 4:57 PM
To: Peter Guzis; [EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: Re: RE: RE: Perl 5.8 IIS 5.0 hangs on script failure


It just return the error to the browser. Can't locate drive://dir/file.ext in @INC 
But, when I dont use eval PerlIS crashes and that is not normal.


- Mensaje Original -
Fecha: 08/Ene/2004 04:36:05 PM
De: [EMAIL PROTECTED]
Para: [EMAIL PROTECTED], [EMAIL PROTECTED] 
Asunto: RE: RE: Perl 5.8 IIS 5.0 hangs on script failure

What happens if you enclose the require in an eval{} block?

Peter Guzis
Web Administrator, Sr.
ENCAD, Inc.
- A Kodak Company
email: [EMAIL PROTECTED]
www.encad.com 

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Thursday, January 08, 2004 4:32 PM
To: Peter Guzis; [EMAIL PROTECTED]
Subject: Re: RE: Perl 5.8 IIS 5.0 hangs on script failure




- Mensaje Original -
Fecha: 08/Ene/2004 03:28:11 PM
De: [EMAIL PROTECTED]
Para: [EMAIL PROTECTED] 
Asunto: RE: Perl 5.8 IIS 5.0 hangs on script failure

What are you trying to require?

Nothing in particular...
Just that when I use ''require'' and call an external script and for some reason I
misstype the name of the external script, then instead of getting the error printed
, Perl hangs and I have to restart IIS in order to make it work again.



Peter Guzis
Web Administrator, Sr.
ENCAD, Inc.
- A Kodak Company
email: [EMAIL PROTECTED]
www.encad.com 

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Thursday, January 08, 2004 3:13 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: Perl 5.8 IIS 5.0 hangs on script failure


what is the exact build number for ActivePerl? the latest is 808. Also, 
does this occur on any script ie something as simple as:

# start code
use strict;
use CGI;

my $page = new CGI;

# print header and start the markup output

print $page-header( ''text/html'' );
print $page-start_html( ''hello from perl cgi!'' );
print $page-h2(''hello dave...'');
print $page-end_html;

# end code

Build is 808. At the time this occurs only when using ''require'', which I use 
a 
lot.


it also looks like you are using ISAPI - does this only occur with ISAPI 
or is perl.exe causing problems as well?

Yes, this happens only when using PerlIS (Perl ISAPI)

By now I have turned off ISAPI and went back to Perl.exe. But I would really like

to know what is the reason why PerlIS behaves like this in this version of Perl.

If someone has the answer please let me know.

Thanks in advance
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs







___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: RE: RE: RE: Perl 5.8 IIS 5.0 hangs on script failure

2004-01-08 Thread desarrollo

Thanks for your help but I think you are not getting the point.

The problem is not when I access an external file that actually exists. When it exists 
there's no problem at all. The require line works great if no errors are encountered.

The real problem is when I need to require, say require xy.pl (which actually 
exists) and I misstype the name and type require xx.pl (which doesn't exists), and 
then instead of getting an error like ''Can't locate drive://dir/file.ext in @INC'', 
PerlIS just crashes and the only way to make it work again is by restarting IIS.

I dont get any crash if the file exists. The problem is that PerlIS crashes on script 
failure instead of just printing the error and line of error.

On the other hand, I dont think it has anything to do with permissions. Perl 5.6 
worked great and earlier versions also worked great using Perl.exe or PerlIS.dll in 
this very same server. This problem started when I installed Perl 5.8 build 808 last 
week.

The only thing that is making me crazy is to have to restart IIS everytime I get an 
error because I misstyped a line of code. The normal behavior of Perl should be to 
print the error or log it, not to crash until IIS is restarted.

I think I'll try reintalling Perl and if it doesnt fix, then I'll just use to Perl.exe 
instead of PerlIS.dll.

Thanks again for your help, you are very kind. :)

- Mensaje Original -
Fecha: 08/Ene/2004 05:05:48 PM
De: [EMAIL PROTECTED]
Para: [EMAIL PROTECTED], [EMAIL PROTECTED] 
Asunto: RE: RE: RE: Perl 5.8 IIS 5.0 hangs on script failure

Hmm.  Perhaps it is permissions-related.  As a test, can you try just opening the
required file for read access?

### example script (bare minimum)

open (IN, ''path/to/file'') or die ''Could not read file: $!\n'';

###

If this doesn't shed any light, perhaps you should post the first few lines of 
your script verbatim. 

Peter Guzis
Web Administrator, Sr.
ENCAD, Inc.
- A Kodak Company
email: [EMAIL PROTECTED]
www.encad.com 

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Thursday, January 08, 2004 4:57 PM
To: Peter Guzis; [EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: Re: RE: RE: Perl 5.8 IIS 5.0 hangs on script failure


It just return the error to the browser. ''Can't locate drive://dir/file.ext in @
INC'' But, when I dont use eval PerlIS crashes and that is not normal.


- Mensaje Original -
Fecha: 08/Ene/2004 04:36:05 PM
De: [EMAIL PROTECTED]
Para: [EMAIL PROTECTED], [EMAIL PROTECTED] 
Asunto: RE: RE: Perl 5.8 IIS 5.0 hangs on script failure

What happens if you enclose the require in an eval{} block?

Peter Guzis
Web Administrator, Sr.
ENCAD, Inc.
- A Kodak Company
email: [EMAIL PROTECTED]
www.encad.com 

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Thursday, January 08, 2004 4:32 PM
To: Peter Guzis; [EMAIL PROTECTED]
Subject: Re: RE: Perl 5.8 IIS 5.0 hangs on script failure




- Mensaje Original -
Fecha: 08/Ene/2004 03:28:11 PM
De: [EMAIL PROTECTED]
Para: [EMAIL PROTECTED] 
Asunto: RE: Perl 5.8 IIS 5.0 hangs on script failure

What are you trying to require?

Nothing in particular...
Just that when I use ''require'' and call an external script and for some reason
I
misstype the name of the external script, then instead of getting the error printed

, Perl hangs and I have to restart IIS in order to make it work again.



Peter Guzis
Web Administrator, Sr.
ENCAD, Inc.
- A Kodak Company
email: [EMAIL PROTECTED]
www.encad.com 

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Thursday, January 08, 2004 3:13 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: Perl 5.8 IIS 5.0 hangs on script failure


what is the exact build number for ActivePerl? the latest is 808. Also, 
does this occur on any script ie something as simple as:

# start code
use strict;
use CGI;

my $page = new CGI;

# print header and start the markup output

print $page-header( ''text/html'' );
print $page-start_html( ''hello from perl cgi!'' );
print $page-h2(''hello dave...'');
print $page-end_html;

# end code

Build is 808. At the time this occurs only when using ''require'', which I use

a 
lot.


it also looks like you are using ISAPI - does this only occur with ISAPI 
or is perl.exe causing problems as well?

Yes, this happens only when using PerlIS (Perl ISAPI)

By now I have turned off ISAPI and went back to Perl.exe. But I would really 
like

to know what is the reason why PerlIS behaves like this in this version of Perl.

If someone has the answer please let me know.

Thanks in advance
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

RE: RE: RE: RE: Perl 5.8 IIS 5.0 hangs on script failure

2004-01-08 Thread Peter Guzis
Ok, that puts things a bit more in perspective. :P

FWIW, the only times I have ever had real stability problems with PerlIS (PerlEx, 
also) have been when I used non-thread-safe modules.

When you installed ActivePerl 5.8 did you, perchance, uninstall 5.6 first?  If you are 
going to re-install anyway, I would recommend uninstalling all versions of Perl and 
deleting the residual /Perl directory structure.  5.6 and 5.8 aren't binary-compatible 
and all sorts of weird things could conceivably happen if they are pulling modules 
from the same location.

Good luck!


Peter Guzis
Web Administrator, Sr.
ENCAD, Inc.
- A Kodak Company
email: [EMAIL PROTECTED]
www.encad.com 

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Thursday, January 08, 2004 5:53 PM
To: [EMAIL PROTECTED]
Subject: Re: RE: RE: RE: Perl 5.8 IIS 5.0 hangs on script failure



Thanks for your help but I think you are not getting the point.

The problem is not when I access an external file that actually exists. When it exists 
there's no problem at all. The require line works great if no errors are encountered.

The real problem is when I need to require, say require xy.pl (which actually 
exists) and I misstype the name and type require xx.pl (which doesn't exists), and 
then instead of getting an error like ''Can't locate drive://dir/file.ext in @INC'', 
PerlIS just crashes and the only way to make it work again is by restarting IIS.

I dont get any crash if the file exists. The problem is that PerlIS crashes on script 
failure instead of just printing the error and line of error.

On the other hand, I dont think it has anything to do with permissions. Perl 5.6 
worked great and earlier versions also worked great using Perl.exe or PerlIS.dll in 
this very same server. This problem started when I installed Perl 5.8 build 808 last 
week.

The only thing that is making me crazy is to have to restart IIS everytime I get an 
error because I misstyped a line of code. The normal behavior of Perl should be to 
print the error or log it, not to crash until IIS is restarted.

I think I'll try reintalling Perl and if it doesnt fix, then I'll just use to Perl.exe 
instead of PerlIS.dll.

Thanks again for your help, you are very kind. :)

- Mensaje Original -
Fecha: 08/Ene/2004 05:05:48 PM
De: [EMAIL PROTECTED]
Para: [EMAIL PROTECTED], [EMAIL PROTECTED] 
Asunto: RE: RE: RE: Perl 5.8 IIS 5.0 hangs on script failure

Hmm.  Perhaps it is permissions-related.  As a test, can you try just opening the
required file for read access?

### example script (bare minimum)

open (IN, ''path/to/file'') or die ''Could not read file: $!\n'';

###

If this doesn't shed any light, perhaps you should post the first few lines of 
your script verbatim. 

Peter Guzis
Web Administrator, Sr.
ENCAD, Inc.
- A Kodak Company
email: [EMAIL PROTECTED]
www.encad.com 

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Thursday, January 08, 2004 4:57 PM
To: Peter Guzis; [EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: Re: RE: RE: Perl 5.8 IIS 5.0 hangs on script failure


It just return the error to the browser. ''Can't locate drive://dir/file.ext in @
INC'' But, when I dont use eval PerlIS crashes and that is not normal.


- Mensaje Original -
Fecha: 08/Ene/2004 04:36:05 PM
De: [EMAIL PROTECTED]
Para: [EMAIL PROTECTED], [EMAIL PROTECTED] 
Asunto: RE: RE: Perl 5.8 IIS 5.0 hangs on script failure

What happens if you enclose the require in an eval{} block?

Peter Guzis
Web Administrator, Sr.
ENCAD, Inc.
- A Kodak Company
email: [EMAIL PROTECTED]
www.encad.com 

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Thursday, January 08, 2004 4:32 PM
To: Peter Guzis; [EMAIL PROTECTED]
Subject: Re: RE: Perl 5.8 IIS 5.0 hangs on script failure




- Mensaje Original -
Fecha: 08/Ene/2004 03:28:11 PM
De: [EMAIL PROTECTED]
Para: [EMAIL PROTECTED] 
Asunto: RE: Perl 5.8 IIS 5.0 hangs on script failure

What are you trying to require?

Nothing in particular...
Just that when I use ''require'' and call an external script and for some reason
I
misstype the name of the external script, then instead of getting the error printed

, Perl hangs and I have to restart IIS in order to make it work again.



Peter Guzis
Web Administrator, Sr.
ENCAD, Inc.
- A Kodak Company
email: [EMAIL PROTECTED]
www.encad.com 

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Thursday, January 08, 2004 3:13 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: Perl 5.8 IIS 5.0 hangs on script failure


what is the exact build number for ActivePerl? the latest is 808. Also, 
does this occur on any script ie something as simple as:

# start code
use strict;
use CGI;

my $page = new CGI;

# print header and start the markup output

print $page-header( ''text/html'' );
print $page-start_html( ''hello from perl cgi!'' );
print $page-h2

Re: RE: RE: RE: RE: Perl 5.8 IIS 5.0 hangs on script failure

2004-01-08 Thread desarrollo
Yes, I know this. In fact, on every upgrade of any software I clean everything from 
uninstalling to regcleanning and delete residual dirs also. So I did when installing 
this new version.

Thanks for your advice anyhow because it's valid. 
Also, thank you for taking the time to reply. You and all who replied :)


- Mensaje Original -
Fecha: 08/Ene/2004 06:06:13 PM
De: [EMAIL PROTECTED]
Para: [EMAIL PROTECTED], [EMAIL PROTECTED] 
Asunto: RE: RE: RE: RE: Perl 5.8 IIS 5.0 hangs on script failure

Ok, that puts things a bit more in perspective. :P

FWIW, the only times I have ever had real stability problems with PerlIS (PerlEx
, also) have been when I used non-thread-safe modules.

When you installed ActivePerl 5.8 did you, perchance, uninstall 5.6 first?  If 
you are going to re-install anyway, I would recommend uninstalling all versions 
of Perl and deleting the residual /Perl directory structure.  5.6 and 5.8 aren't
binary-compatible and all sorts of weird things could conceivably happen if they
are pulling modules from the same location.

Good luck!


Peter Guzis
Web Administrator, Sr.
ENCAD, Inc.
- A Kodak Company
email: [EMAIL PROTECTED]
www.encad.com 

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Thursday, January 08, 2004 5:53 PM
To: [EMAIL PROTECTED]
Subject: Re: RE: RE: RE: Perl 5.8 IIS 5.0 hangs on script failure



Thanks for your help but I think you are not getting the point.

The problem is not when I access an external file that actually exists. When it 
exists there's no problem at all. The ''require'' line works great if no errors are
encountered.

The real problem is when I need to require, say require ''xy.pl'' (which actually 
exists) and I misstype the name and type require ''xx.pl'' (which doesn't exists), 
and then instead of getting an error like ''Can't locate drive://dir/file.ext in
@INC'', PerlIS just crashes and the only way to make it work again is by restarting
IIS.

I dont get any crash if the file exists. The problem is that PerlIS crashes on 
script failure instead of just printing the error and line of error.

On the other hand, I dont think it has anything to do with permissions. Perl 5.6
worked great and earlier versions also worked great using Perl.exe or PerlIS.dll
in this very same server. This problem started when I installed Perl 5.8 build 
808 last week.

The only thing that is making me crazy is to have to restart IIS everytime I get
an error because I misstyped a line of code. The normal behavior of Perl should
be to print the error or log it, not to crash until IIS is restarted.

I think I'll try reintalling Perl and if it doesnt fix, then I'll just use to 
Perl.exe instead of PerlIS.dll.

Thanks again for your help, you are very kind. :)

- Mensaje Original -
Fecha: 08/Ene/2004 05:05:48 PM
De: [EMAIL PROTECTED]
Para: [EMAIL PROTECTED], [EMAIL PROTECTED] 
Asunto: RE: RE: RE: Perl 5.8 IIS 5.0 hangs on script failure

Hmm.  Perhaps it is permissions-related.  As a test, can you try just opening 
the
required file for read access?

### example script (bare minimum)

open (IN, ''path/to/file'') or die ''Could not read file: $!\n'';

###

If this doesn't shed any light, perhaps you should post the first few lines of

your script verbatim. 

Peter Guzis
Web Administrator, Sr.
ENCAD, Inc.
- A Kodak Company
email: [EMAIL PROTECTED]
www.encad.com 

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Thursday, January 08, 2004 4:57 PM
To: Peter Guzis; [EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: Re: RE: RE: Perl 5.8 IIS 5.0 hangs on script failure


It just return the error to the browser. ''Can't locate drive://dir/file.ext in
@
INC'' But, when I dont use eval PerlIS crashes and that is not normal.


- Mensaje Original -
Fecha: 08/Ene/2004 04:36:05 PM
De: [EMAIL PROTECTED]
Para: [EMAIL PROTECTED], [EMAIL PROTECTED] 
Asunto: RE: RE: Perl 5.8 IIS 5.0 hangs on script failure

What happens if you enclose the require in an eval{} block?

Peter Guzis
Web Administrator, Sr.
ENCAD, Inc.
- A Kodak Company
email: [EMAIL PROTECTED]
www.encad.com 

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Thursday, January 08, 2004 4:32 PM
To: Peter Guzis; [EMAIL PROTECTED]
Subject: Re: RE: Perl 5.8 IIS 5.0 hangs on script failure




- Mensaje Original -
Fecha: 08/Ene/2004 03:28:11 PM
De: [EMAIL PROTECTED]
Para: [EMAIL PROTECTED] 
Asunto: RE: Perl 5.8 IIS 5.0 hangs on script failure

What are you trying to require?

Nothing in particular...
Just that when I use ''require'' and call an external script and for some reason

I
misstype the name of the external script, then instead of getting the error printed


, Perl hangs and I have to restart IIS in order to make it work again.



Peter Guzis
Web Administrator, Sr.
ENCAD, Inc.
- A Kodak Company
email: [EMAIL PROTECTED]
www.encad.com 

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL

Re: Perl 5.8 IIS 5.0 hangs on script failure

2004-01-08 Thread desarrollo
Yes, I understood that in the very first email you adviced me to use eval. In fact, I 
replied to you saying that the script printed the error and PerlIS did not hang. 
But... what if I have dozens of scripts I have coded in years and all of them use one 
or more lines of require? do I have to recode all of those scripts that worked just 
fine on every earlier version of Perl just because of this bug? Well, Im not sure if 
this is a bug, but it is very annoying. :)

To put this more visible. Some of my scripts call external files depending on query 
string. 
For example, if you type http://myhost/script.pl?page=start 
then start.ext is required from scripts.pl using:

$page=param('page');
require $page;

So if some visitor, just for curiosity or for fun, types 
http://myhost/script.pl?page=kakahs7ehendn (which does not exist) then with this error 
Perl is throwing on this version, the user would crash the server instead of receiving 
an error like kakahs7ehendn.ext was not found in @INC. See what I mean?

Also, imagine that I have no admin control over the server my scripts are running and 
this happened? what could I do? The would I have to fix every script I have coded 
before because I didn't use eval? I mean, is it normal to enclose require with eval? I 
have seen a lot of other people's scripts and none of them use eval when requiring an 
external file.

That is my point and the real reason why I posted this. Is that I dont get why PerlIS 
behaves like this in this version when earlier versions didnt act like this. I have 
never enclosed require lines with eval before and PerlIS never did this even if I 
didnt use eval.

Fortunately I have admin control over the server and I can change which program 
controls the pl files so I'll try reinstalling Perl or changing PerlIS to Perl.exe in 
not success :)

Thanks again for taking the time to reply :)

- Mensaje Original -
Fecha: 09/Ene/2004 01:10:28 PM
De: [EMAIL PROTECTED]
Para: recipientes ocultos 
Asunto: Re: Perl 5.8 IIS 5.0 hangs on script failure

[EMAIL PROTECTED] wrote:
 Thanks for your help but I think you are not getting the point.
 
 The problem is not when I access an external file that actually exists. When 
it exists there's no problem at all. The ''require'' line works great if no errors
are encountered.
 
 The real problem is when I need to require, say require ''xy.pl'' (which actually
exists) and I misstype the name and type require ''xx.pl'' (which doesn't exists
), and then instead of getting an error like ''Can't locate drive://dir/file.ext
in @INC'', PerlIS just crashes and the only way to make it work again is by restarting
IIS.
 
 I dont get any crash if the file exists. The problem is that PerlIS crashes on
script failure instead of just printing the error and line of error.
 
 On the other hand, I dont think it has anything to do with permissions. Perl 5.6 
 worked great and earlier versions also worked great using Perl.exe or PerlIS.
dll in this very same server. This problem started when I installed Perl 5.8 build
808 last week.
 
 The only thing that is making me crazy is to have to restart IIS everytime I 
get an error because I misstyped a line of code. The normal behavior of Perl should
be to print the error or log it, not to crash until IIS is restarted.
 
 I think I'll try reintalling Perl and if it doesnt fix, then I'll just use to 
Perl.exe instead of PerlIS.dll.
 
 Thanks again for your help, you are very kind. :)
 

Yes, I understand all of that and you are quite right to want to get it 
fixed. However, I'm not sure that *you* understand the significance of 
using 'eval' so I'll elaborate.

Supposedly in your script you have something like:

require $file;

The suggestion is that you change that to:

eval {require $file};
if($@) {
   print ''[EMAIL PROTECTED] because of above error\n'';
   exit;
   }

Then, if the file does not exist, the script will exit *without* 
hanging. And if the file *does* exist then it will be loaded and the 
program continues on as per normal.

So if you make that change, then you won't have to change *anything* 
else and there will be *no* hanging. You can have everything proceeding 
smoothly while you continue to try to work out what's causing that problem.

Cheers,
Rob

-- 
Any emails containing attachments will be deleted from my ISP's mail 
server before I even get to see them. If you wish to email me an 
attachment, please provide advance warning so that I can make the 
necessary arrangements.

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Perl 5.8 IIS 5.0 hangs on script failure

2004-01-08 Thread $Bill Luebkert
[EMAIL PROTECTED] wrote:

 Yes, I understood that in the very first email you adviced me to use eval. In fact, 
 I replied to you saying that the script printed the error and PerlIS did not hang. 
 But... what if I have dozens of scripts I have coded in years and all of them use 
 one or more lines of require? do I have to recode all of those scripts that worked 
 just fine on every earlier version of Perl just because of this bug? Well, Im not 
 sure if this is a bug, but it is very annoying. :)
 
 To put this more visible. Some of my scripts call external files depending on query 
 string. 
 For example, if you type http://myhost/script.pl?page=start 
 then start.ext is required from scripts.pl using:
 
 $page=param('page');
 require $page;
 
 So if some visitor, just for curiosity or for fun, types 
 http://myhost/script.pl?page=kakahs7ehendn (which does not exist) then with this 
 error Perl is throwing on this version, the user would crash the server instead of 
 receiving an error like kakahs7ehendn.ext was not found in @INC. See what I mean?

It would be silly to allow a user supplied parameter to cause your script to fail.

You could easily check the parameter before actually using it in a do/require.
eg: if (-f $page.ext) { do $page; } # check for plain file before using

You should probably also make sure you remove any /s etc from a path before
shelling out or using that path in a manner that would allow the user to
access other directories on the computer.  An ideal solution would be to
have a list of all the possible allowed pages in a hash anbd check for
existence in the hash.

Lack of defensive coding can only hurt you in the long run.

 Also, imagine that I have no admin control over the server my scripts are running 
 and this happened? what could I do? The would I have to fix every script I have 
 coded before because I didn't use eval? I mean, is it normal to enclose require with 
 eval? I have seen a lot of other people's scripts and none of them use eval when 
 requiring an external file.
 
 That is my point and the real reason why I posted this. Is that I dont get why 
 PerlIS behaves like this in this version when earlier versions didnt act like this. 
 I have never enclosed require lines with eval before and PerlIS never did this 
 even if I didnt use eval.


-- 
  ,-/-  __  _  _ $Bill LuebkertMailto:[EMAIL PROTECTED]
 (_/   /  )// //   DBE CollectiblesMailto:[EMAIL PROTECTED]
  / ) /--  o // //  Castle of Medieval Myth  Magic http://www.todbe.com/
-/-' /___/__/_/_http://dbecoll.tripod.com/ (My Perl/Lakers stuff)

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Perl 5.8 IIS 5.0 hangs on script failure

2004-01-08 Thread Lynn. Rickards
 
 
 [EMAIL PROTECTED] wrote:
 
  Yes, I understood that in the very first email you adviced 
 me to use eval. In fact, I replied to you saying that the 
 script printed the error and PerlIS did not hang. But... what 
 if I have dozens of scripts I have coded in years and all of 
 them use one or more lines of require? do I have to recode 
 all of those scripts that worked just fine on every earlier 
 version of Perl just because of this bug? Well, Im not sure 
 if this is a bug, but it is very annoying. :)
  
  To put this more visible. Some of my scripts call external 
 files depending on query string. 
  For example, if you type http://myhost/script.pl?page=start 
  then start.ext is required from scripts.pl using:
  
  $page=param('page');
  require $page;
  
  So if some visitor, just for curiosity or for fun, types 
 http://myhost/script.pl?page=kakahs7ehendn (which does not 
 exist) then with this error Perl is throwing on this version, 
 the user would crash the server instead of receiving an error 
 like kakahs7ehendn.ext was not found in @INC. See what I mean?
 
 It would be silly to allow a user supplied parameter to cause 
 your script to fail.
 
 You could easily check the parameter before actually using it 
 in a do/require.
 eg: if (-f $page.ext) { do $page; } # check for plain file 
 before using
 
 You should probably also make sure you remove any /s etc from 
 a path before
 shelling out or using that path in a manner that would allow 
 the user to
 access other directories on the computer.  An ideal solution 
 would be to
 have a list of all the possible allowed pages in a hash anbd check for
 existence in the hash.
 
 Lack of defensive coding can only hurt you in the long run.
 
  Also, imagine that I have no admin control over the server 
 my scripts are running and this happened? what could I do? 
 The would I have to fix every script I have coded before 
 because I didn't use eval? I mean, is it normal to enclose 
 require with eval? I have seen a lot of other people's 
 scripts and none of them use eval when requiring an external file.
  
  That is my point and the real reason why I posted this. Is 
 that I dont get why PerlIS behaves like this in this version 
 when earlier versions didnt act like this. I have never 
 enclosed require lines with eval before and PerlIS never 
 did this even if I didnt use eval.
 
 

So...as is invariably the case :-) $Bill's is sound and
reasoned advice. There remains that discrepancy though, 
between perl.exe and the DLL.

I don't want to muddy the waters but as IIs is hanging, it 
appears it is waiting for something. Could it be as simple 
as '\n' following the error output? Not something you would be 
able to cater for in your script...but a small fix to the DLL...

-Lynn's $0.02. 

(I communicate with some other apps that refuse to move 
without a '\n' or kill -9)...  
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Perl 5.8 IIS 5.0 hangs on script failure

2004-01-08 Thread desarrollo


- Mensaje Original -
Fecha: 08/Ene/2004 07:52:44 PM
De: [EMAIL PROTECTED]
Para: [EMAIL PROTECTED] 
Asunto: Re: Perl 5.8 IIS 5.0 hangs on script failure

[EMAIL PROTECTED] wrote:

 Yes, I understood that in the very first email you adviced me to use eval. In 
fact, I replied to you saying that the script printed the error and PerlIS did 
not hang. But... what if I have dozens of scripts I have coded in years and all 
of them use one or more lines of ''require''? do I have to recode all of those scripts
that worked just fine on every earlier version of Perl just because of this bug
? Well, Im not sure if this is a bug, but it is very annoying. :)
 
 To put this more visible. Some of my scripts call external files depending on 
query string. 
 For example, if you type http://myhost/script.pl?page=start 
 then start.ext is required from scripts.pl using:
 
 $page=param('page');
 require $page;
 
 So if some visitor, just for curiosity or for fun, types http://myhost/script.
pl?page=kakahs7ehendn (which does not exist) then with this error Perl is throwing
on this version, the user would crash the server instead of receiving an error 
like ''kakahs7ehendn.ext was not found in @INC''. See what I mean?

It would be silly to allow a user supplied parameter to cause your script to fail.

You could easily check the parameter before actually using it in a do/require.
eg: if (-f ''$page.ext'') { do $page; } # check for plain file before using

You should probably also make sure you remove any /s etc from a path before
shelling out or using that path in a manner that would allow the user to
access other directories on the computer.  An ideal solution would be to
have a list of all the possible allowed pages in a hash anbd check for
existence in the hash.

Lack of defensive coding can only hurt you in the long run.


Well, you are right but it would hurt because it would always put the extension after 
the file name. For example, in this code:

require 'e:/mysite/mydir/'.$page.'.reqfile';

In this case if a user types whatever on the query string say to gain access to 
executables, for example http://mysite.ext/?page=perl.exe; the script actually would 
look for 'e:/mysite/mydir/perl.exe.reqfile'. So, even if the executable file (in this 
case perl.exe) was located in that dir (which wouldnt be), the user would receive an 
error because the script is looking for perl.exe.reqfile and no perl.exe. Also if 
the user gained access to other directory different from e:/mysite/mydir/, he 
couldn't get access to any file different from a file with .reqfile extension. The 
.reqfile extension will always get in front of the path.

Am I right or wrong?



 Also, imagine that I have no admin control over the server my scripts are running
and this happened? what could I do? The would I have to fix every script I have
coded before because I didn't use eval? I mean, is it normal to enclose require
with eval? I have seen a lot of other people's scripts and none of them use eval
when requiring an external file.
 
 That is my point and the real reason why I posted this. Is that I dont get why
PerlIS behaves like this in this version when earlier versions didnt act like 
this. I have never enclosed ''require'' lines with ''eval'' before and PerlIS never 
did this even if I didnt use ''eval''.


-- 
 ,-/-  __  _  _ $Bill LuebkertMailto:[EMAIL PROTECTED]
(_/   /  )// //   DBE CollectiblesMailto:[EMAIL PROTECTED]
 / ) /--  o // //  Castle of Medieval Myth  Magic http://www.todbe.com/
-/-' /___/__/_/_http://dbecoll.tripod.com/ (My Perl/Lakers stuff)

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Perl 5.8 IIS 5.0 hangs on script failure

2004-01-08 Thread $Bill Luebkert
[EMAIL PROTECTED] wrote:

 
 - Mensaje Original -
 Fecha: 08/Ene/2004 07:52:44 PM
 De: [EMAIL PROTECTED]
 Para: [EMAIL PROTECTED] 
 Asunto: Re: Perl 5.8 IIS 5.0 hangs on script failure
 
 
[EMAIL PROTECTED] wrote:


Yes, I understood that in the very first email you adviced me to use eval. In 

fact, I replied to you saying that the script printed the error and PerlIS did 
not hang. But... what if I have dozens of scripts I have coded in years and all 
of them use one or more lines of ''require''? do I have to recode all of those 
scripts
that worked just fine on every earlier version of Perl just because of this bug
? Well, Im not sure if this is a bug, but it is very annoying. :)

To put this more visible. Some of my scripts call external files depending on 

query string. 

For example, if you type http://myhost/script.pl?page=start 
then start.ext is required from scripts.pl using:

$page=param('page');
require $page;

So if some visitor, just for curiosity or for fun, types http://myhost/script.

pl?page=kakahs7ehendn (which does not exist) then with this error Perl is throwing
on this version, the user would crash the server instead of receiving an error 
like ''kakahs7ehendn.ext was not found in @INC''. See what I mean?

It would be silly to allow a user supplied parameter to cause your script to fail.

You could easily check the parameter before actually using it in a do/require.
eg: if (-f ''$page.ext'') { do $page; } # check for plain file before using

You should probably also make sure you remove any /s etc from a path before
shelling out or using that path in a manner that would allow the user to
access other directories on the computer.  An ideal solution would be to
have a list of all the possible allowed pages in a hash anbd check for
existence in the hash.

Lack of defensive coding can only hurt you in the long run.
 
 
 
 Well, you are right but it would hurt because it would always put the extension 
 after the file name. For example, in this code:
 
 require 'e:/mysite/mydir/'.$page.'.reqfile';
 
 In this case if a user types whatever on the query string say to gain access to 
 executables, for example http://mysite.ext/?page=perl.exe; the script actually 
 would look for 'e:/mysite/mydir/perl.exe.reqfile'. So, even if the executable file 
 (in this case perl.exe) was located in that dir (which wouldnt be), the user would 
 receive an error because the script is looking for perl.exe.reqfile and no 
 perl.exe. Also if the user gained access to other directory different from 
 e:/mysite/mydir/, he couldn't get access to any file different from a file with 
 .reqfile extension. The .reqfile extension will always get in front of the path.
 
 Am I right or wrong?

Kinda depends on what you're doing.  If you shell out, you would be wrong.
There's nothing to stop $page from being something like :
'../../../cmd.exe /C possibly more stuff'
In the case of a require, you're probably only hurting yourself by having
a script failure.  I still say that you should check the $page before using
to prevent the failure.

-- 
  ,-/-  __  _  _ $Bill LuebkertMailto:[EMAIL PROTECTED]
 (_/   /  )// //   DBE CollectiblesMailto:[EMAIL PROTECTED]
  / ) /--  o // //  Castle of Medieval Myth  Magic http://www.todbe.com/
-/-' /___/__/_/_http://dbecoll.tripod.com/ (My Perl/Lakers stuff)

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs