By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,834 Members | 2,240 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,834 IT Pros & Developers. It's quick & easy.

A simple Perlscript in ASP page fails in ActivePerl 5.6, 5.8, and 5.10.

P: 2
I have a page using Perlscript in ASP. I installed ActivePerl 5.6, 5.8, and 5.10 to no success. I am running the page in IIS on XP SP3.

The program is as follows:
Expand|Select|Wrap|Line Numbers
  1. <%@ Language=PerlScript %> 
  2. <HTML> 
  3. <BODY> 
  4. <%
  5. use warnings;
  6. use strict;
  7. use ASP qw(:strict);
  8. foreach my $item(Win32::OLE::in $Request-> ServerVariables)
  9. {
  10.     print "$item = ";
  11.     print $Request-> ServerVariables($item)->Item;
  12.     print "<BR> \n";
  13. }%> 
  14. </BODY>  
  15. </HTML>
  16.  
Each time I modied this program by adding a blank saved it, I was able to see the correct results. However, an immediate refresh alwasy got the following error:

-------
PerlScript Error error '80004005'
(in cleanup) Can't call method "Item" on an undefined value
/test.asp, line 14
-------

I am new to Perlscrip in ASP. I spent the better part of the last two days searching and testing but am unable to fix it. Does anybody have similar experience before? What is the root cause for this? What do I miss in this?

Thanks for your input!!!

Regards.
Oct 12 '09 #1
Share this Question
Share on Google+
3 Replies


numberwhun
Expert Mod 2.5K+
P: 3,503
@DavidCZ
Bear with me as I have no experience with Perlscript or its embedding in ASP. But, at first glance, the error is pretty specific and says that the 'Item' is not defined. That is something you need to look into.

Looking at your foreach line, this bugs me:

Expand|Select|Wrap|Line Numbers
  1. Win32::OLE::in $Request-> ServerVariables
  2.  
I doubt that the Win32::OLE module has a sub module named "in". This seems to be a mis use of the module. Also, you don't include a "use" statement for the Win32::OLE module either.

I am going to guess that you found an example of this and they put the word "Item" in place of the key that you want to look up in the hash and that the example expected you to replace that with what you are trying to get the value of.

Hopefully this will guide you in the right direction. If my suspicion is correct and you were referencing a tutorial or some documentation, maybe you could provide the link to it for us.

One other thing, please use code tags around any code you place in the forums.

Regards,

Jeff
Oct 13 '09 #2

P: 2
Jeff,

Thanks so much for your input.

>>If my suspicion is correct and you were referencing a tutorial or some documentation, maybe you could provide the link to it for us.

You are perfectly right. I was testing my Perl environment setup and I had a problem. I googled the internet and found a similar problem and copied the code from there:

http://aspn.activestate.com/ASPN/Mai...32-web/3364053

Please note that my problem is very similar to the above one. Also please note that I am able to get CORRECT results in the first page reload after I modify the program by adding a blank and saved it. Correct results look like the following:

----
ALL_HTTP = HTTP_ACCEPT:*/* HTTP_ACCEPT_LANGUAGE:en-us HTTP_CONNECTION:Keep-Alive HTTP_HOST:localhost HTTP_USER_AGENT:Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727; InfoPath.2; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; MS-RTC LM 8; .NET CLR 1.1.4322) HTTP_COOKIE:fontSize=90; mybbuser=7_vTDZG4QIecDu3eINK5dAjxTSvXgMMWeclCJgN2u 1l7FrR88YHv; FSRCookie=ForeseeLoyalty=31||ForeseeSurveyShown=tr ue; CFID=101; CFTOKEN=36111908; wp-settings-time-1=1251813047; ASPSESSIONIDCQQRSQSD=JAIHBIHBAOKGBPJLPJFHFIAH; JSESSIONID=8230670881255357669109; ASPSESSIONIDCQSSRQTD=NGCBFDKBCKEHCCKHBJCHIAAK HTTP_UA_CPU:x86 HTTP_ACCEPT_ENCODING:gzip, deflate
ALL_RAW = Accept: */* Accept-Language: en-us Connection: Keep-Alive Host: localhost User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727; InfoPath.2; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; MS-RTC LM 8; .NET CLR 1.1.4322) Cookie: fontSize=90; mybbuser=7_vTDZG4QIecDu3eINK5dAjxTSvXgMMWeclCJgN2u 1l7FrR88YHv; FSRCookie=ForeseeLoyalty=31||ForeseeSurveyShown=tr ue; CFID=101; CFTOKEN=36111908; wp-settings-time-1=1251813047; ASPSESSIONIDCQQRSQSD=JAIHBIHBAOKGBPJLPJFHFIAH; JSESSIONID=8230670881255357669109; ASPSESSIONIDCQSSRQTD=NGCBFDKBCKEHCCKHBJCHIAAK UA-CPU: x86 Accept-Encoding: gzip, deflate
APPL_MD_PATH = /LM/W3SVC/1/Root
APPL_PHYSICAL_PATH = C:\Websites\NMAH-MainBranch\
AUTH_PASSWORD =
AUTH_TYPE =
AUTH_USER =
CERT_COOKIE =
CERT_FLAGS =
CERT_ISSUER =
....
---------------------

However, the error in my original post happens in every later page reload. As I said, I am new to perl and so I copied the example in the above link for testing. To get things simpler. I also used the following example for tests with activeperl 5.6, 5.8, 5.10 and got the error PATTERN:

<%@ Language=PerlScript %>
<html>
<head></head>
<body>
Hello World!
</body>
</html>
I am able to see Hello World! in the first page reload after modification. After that, each page reload has NO error message but the page is BLANK.

I dont know what I did is missing. Why am I able to see the correct results in the first page reload? This perl thing really confuses me.

Cheers!
Oct 13 '09 #3

P: 1
I have a very similar problem, and I have a pretty good idea what caused it. I had been running activestate activeperl perlscript library for quite a number of years.

I then installed FastCGI and PHP for Windows. I am fairly certain this is what caused the problem. I get the above "Can't call method "Item" on an undefined value" error now, randomly. It happens every other or every few page loads.

A few things worth noting :

Upon first boot of the server, the PHP sites do not working, reporting a FastCGI error, but the PerlScript site does work. If I leave it in this state, the PerlScript sites have no issues.

Restarting the IIS service gets the PHP sites to work, but the PerlScript sites then have the problem described above. I have not been able to absolutely determine this, but I do think the problems start only after PHP pages are called; that is if the PHP sites are up, that alone does not start the PerlScript sites from going sour.

I have spent a lot of time on this issue and haven't gotten very far. I imagine that it is not so common to have a single IIS server with PHP and PerlScript sites.
Oct 29 '09 #4

Post your reply

Sign in to post your reply or Sign up for a free account.