RE: IIS 6 - PerlEx - causing working process to recycle on ScriptReturned No Data
If you are having the same problem I have (with PerlScript in ASP) where something similar happens, you can downgrade to build 638 (perl 5.6) to correct the problem. Steven -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Horace Redelmyer Sent: Monday, September 17, 2007 8:31 AM To: PerlEx; perl-win32-web@listserv.ActiveState.com Subject: IIS 6 - PerlEx - causing working process to recycle on ScriptReturned No Data I am finding that if the Perl interpreters die (returning Script Returned No Data to the browser), the IIS 6 worker process refuses to handle any more requests. However, the IIS ping every 30s must think that the process is alive since it doesn't recycle until the end of the configured recycle period. Is there any way to cause the worker process to recycle when the interpreters are dead? I'm sure that I am catching all exceptions (e.g. sql query timeouts) in my code in eval blocks. Does anyone know under what circumstances Perl might die? This only happens under stress testing situations. I am using perl v5.8.8 build 822 [280952] from ActiveState with PerlEx on IIS 6 on windows 2003 server. Thanks in advance Horace ___ Perl-Win32-Web mailing list Perl-Win32-Web@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs ___ Perl-Win32-Web mailing list Perl-Win32-Web@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: get html source from web page blocked mouse right button.
OLE can do this if you have Internet Explorer working. Granted.. It's not perfect, but if you want to invest some time in getting all the features worked out, it would be worth it. (like the SCRIPT tags not telling you what is in the SCRIPT).. So, this script is somewhat limited, but can be worked on to get you more if it doesn't give you enough. Please be nice and don't abuse Google, or anyone else for that matter, with this script... :) use Win32::OLE; $oIE = Win32::OLE-new(InternetExplorer.Application); $oIE-{Visible} = 1; $oIE-Navigate(http://www.google.com;); my $rtn = check_ready_state($oIE); if ($rtn != 1) { $oIE-Quit(); exit $rtn; } print Title: .$oIE-Document-{Title}.\n; print $oIE-Document-{All}-{Length}.\n; $x = 0; while ($x $oIE-{Document}-{All}-{Length} - 1) { print $oIE-{Document}-All($x)-{InnerHTML}; $x++; } exit; sub check_ready_state { my $oIE = $_[0]; my $x; while ($oIE-{Busy} == 1) { $x++; if ($x 90) { print IE Is taking a really long time to open\nI've decided to return a failure\n; return 0; } if ($x == 1) { print Ready State: ; } print $oIE-ReadyState; print ... ; if ($oIE-{Busy} == 1) { sleep(1); } } print \n; sleep 2; return 1; } -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Mike Rambour Sent: Tuesday, September 04, 2007 10:00 PM To: perl-win32-web@listserv.ActiveState.com Subject: RE: get html source from web page blocked mouse right button. As Bill already said the View pulldown will do it, I have never seen it not work when the right mouse button was blocked. Also you can do a Save AS At 09:53 PM 9/4/2007, Chang Min Jeon wrote: really, i'm trying to get html source from online webpage blocked mouse right button using perl modules. and i will save this source to html format in my filesystem. so, i find perl module which get html source by using URL. 2007/9/5, Bill Luebkert [EMAIL PROTECTED]: Chang Min Jeon wrote: hello, i want to get html source from web page blocked mouse right button. how to do that ? What browser are we talking about ? If you're using a decent browser there should be a hotkey. On Thunderbird, use Ctrl-U or the View pulldown menu. -- CashFlow To be rich. ___ Perl-Win32-Web mailing list Perl-Win32-Web@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs ___ Perl-Win32-Web mailing list Perl-Win32-Web@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs ___ Perl-Win32-Web mailing list Perl-Win32-Web@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: ASP/PerlScript Issue - Please help
I'd look at the c:\perl\bin\perlse.dll and make sure it's version information says something similar to 5.6.x.638 Then... C:\perl\binregsvr32 perlse.dll If there's anything wrong with the PerlScript, that should help clear it up. However, if that doesn't work, you might try uninstalling perl, deleting the entire directory (C:\Perl) -- backing up any important scripts or modules first, then rebooting, and finally reinstalling perl from scratch followed by a reboot. Make sure that the checkbox for PerlScript and IIS script mappings are on (I think they are by default). Beyond that, I may be of little or no use. Sorry. 638 has always worked in the past. Steven -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Daniel Bacon Sent: Tuesday, December 05, 2006 5:41 AM To: perl-win32-web@listserv.ActiveState.com Subject: RE: ASP/PerlScript Issue - Please help Thank you very much for the response. I down graded to build 638 but I still have the problem. I was on build 638 when the problem first started and only went to 5.8 as a possible fix. Here's little more background. My application ran fine for several years (on Win2K Server). Last week the web server crashed and had to be restarted. I found a A ScriptEngine threw exception 'C005' error in the eventvwr. The error was on a page that was redirected to and also connected to MSSQL. Several bugs reference redirects and database connections but no fix. It seems something has become corrupt. This worked for years and now I can't get rid of this problem. Has this problem been reported on build 638 before? Are there any other possible fixes? -Original Message- From: Steven Manross [mailto:[EMAIL PROTECTED] Sent: Monday, December 04, 2006 9:43 PM To: Daniel Bacon; perl-win32-web@listserv.ActiveState.com Subject: RE: ASP/PerlScript Issue - Please help Loading ActivePerl build 638 should solve your issue, unless there's a reason you can't use that build. http://downloads.activestate.com/ActivePerl/Windows/5.6/Active Perl-5.6.1 .638-MSWin32-x86.msi If you disable Friendly Errors in your browser, you'll see something about ASP telling you it can't SetScriptState properly (there are a few bugs listed in the bug tracker for this problem). They tend to center around trying to do a $Server-Transfer() or $Response-Redirect(), or oddly enough, when trying to use certain COM objects. http://bugs.activestate.com/buglist.cgi?querytype=simpletype% 3Ashort_de sc%3Along_desc%3Abug_file_loc%3Astatus_whiteboard%3Akeywords=s ubstringO R%3Ashort_desc%3Along_desc%3Abug_file_loc%3Astatus_whiteboard% 3Akeywords =SetScriptStatebug_status=UNCONFIRMEDbug_status=NEWbug_stat us=ASSIGNE Dbug_status=REOPENED In IIS6 this problem can be masked by increasing the number of worker processes that you allow your WebGarden to control or decreasing the amount of time IIS will take to recycle the worked processes -- neither gets rid of the problem and have possible side effects that are potentially worse than the initial problem. Activestate has had numerous issues with this issue throughout their later 5.6 builds, and can't seem to track down the issue in 5.8 (or at least they won't comment on any possible fixes, except to say that it might be an IIS 6 issue). Numerous users have relayed similar situations, and there's no solution that I've seen in the years that I've been tracking this bug, except to load build 638 or move to VBScript, JavaScript, VB.NET, etc. Good Luck, Steven -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Daniel Bacon Sent: Monday, December 04, 2006 6:09 PM To: perl-win32-web@listserv.ActiveState.com Subject: ASP/PerlScript Issue - Please help I'm running several ASP pages using PerlScript via IIS. Last week the web server crashed and had to be restarted. Ever since then every ASP page using PerlScript will only run one time. Every time I load the page after that I get a useless page can not be displayed error. If I restart IIS it then runs again one time only. Only ASP pages using PerlScript are affected. I've strip my program down to just this: %@ LANGUAGE=PerlScript % HTML BODY Test /BODY /HTML The first time I load this page I see Test. Every time I refresh/reload the page is blank. If I change PerlScript to JavaScript it works fine. I've tried uninstalling/reinstalling ActivePerl 5.6.1 and I've tried upgrading to version 5.8. I also upgraded MDAC from 2.71 to 2.8. And I've restarted the machine several times. I've been pulling my hair out on this for days. I don't even know what to try next. Any help would be very much appreciated. ___ Perl-Win32-Web mailing list Perl-Win32-Web
RE: ASP/PerlScript Issue - Please help
FYI.. This is not the error I was referring to.. What you were describing seemed so close in how the other error manifests itself, that it seemed to be the other issue. But 638 works to fix that issue. The error I have encountered before, was more of a PerlScript resumed in an unknown state (on the next instantiation of the ASP page). This one sounds like someone's not passing in the test querystring (but I am guessing you are)... Just to see how it's working and or not working, and if other members of the $Request object are being handled properly try these: HTML BODY % #is the entire $Request object out of whack? foreach my $item (Win32::OLE::in $Request-ServerVariables) { $Response-Write($item. = . $Request-ServerVariables($item)-Item . BR\n); }% /BODY /HTML --and-- HTML BODY % #what was passed in the URL foreach my $item (Win32::OLE::in $Request-QueryString) { $Response-Write($item . = . $Request-QueryString($item)-Item . BR\n); }% /BODY /HTML At my house, I navigated to: http://localhost/testquerystring.asp?this=1that=2 And got returned... HTML BODY this = 1BR that = 2BR /BODY /HTML I don't think you should give up yet.. Steven -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Daniel Bacon Sent: Tuesday, December 05, 2006 5:31 PM To: perl-win32-web@listserv.ActiveState.com Subject: RE: ASP/PerlScript Issue - Please help My apologies. I should have included the entire thread in my last post. I've tried uninstalling Perl build 638/reboot/reinstall/reboot and re-registering perlse.dll with no luck. This is a production box and I'm told NO to reinstalling IIS. It doesn't appear that any patches have been installed prior to this problem. I did turn off the friendly HTTP error option and I'm getting this error: PerlScript Error error '80004005' (in cleanup) Can't call method Item on an undefined value The line of code it fails on is: $testvar = $Request-QueryString('test')-Item(); Doing several searches on this error only points me to re-install or upgrade MDAC which I've already tried. This is a nightmare! I guess I'm forced to accept converting this to CGI. Or maybe the smart bet is to re-write this in JavaScript. Thank you all very much for the help! -Dan -Original Message- From: Steven Manross [mailto:[EMAIL PROTECTED] Sent: Tue 12/5/2006 9:03 AM To: Daniel Bacon; perl-win32-web@listserv.ActiveState.com Subject: RE: ASP/PerlScript Issue - Please help I'd look at the c:\perl\bin\perlse.dll and make sure it's version information says something similar to 5.6.x.638 Then... C:\perl\binregsvr32 perlse.dll If there's anything wrong with the PerlScript, that should help clear it up. However, if that doesn't work, you might try uninstalling perl, deleting the entire directory (C:\Perl) -- backing up any important scripts or modules first, then rebooting, and finally reinstalling perl from scratch followed by a reboot. Make sure that the checkbox for PerlScript and IIS script mappings are on (I think they are by default). Beyond that, I may be of little or no use. Sorry. 638 has always worked in the past. Steven -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Daniel Bacon Sent: Tuesday, December 05, 2006 5:41 AM To: perl-win32-web@listserv.ActiveState.com Subject: RE: ASP/PerlScript Issue - Please help Thank you very much for the response. I down graded to build 638 but I still have the problem. I was on build 638 when the problem first started and only went to 5.8 as a possible fix. Here's little more background. My application ran fine for several years (on Win2K Server). Last week the web server crashed and had to be restarted. I found a A ScriptEngine threw exception 'C005' error in the eventvwr. The error was on a page that was redirected to and also connected to MSSQL. Several bugs reference redirects and database connections but no fix. It seems something has become corrupt. This worked for years and now I can't get rid of this problem. Has this problem been reported on build 638 before? Are there any other possible fixes? -Original Message- From: Steven Manross [mailto:[EMAIL PROTECTED] Sent: Monday, December 04, 2006 9:43 PM To: Daniel Bacon; perl-win32-web@listserv.ActiveState.com Subject: RE: ASP/PerlScript Issue - Please help Loading ActivePerl build 638 should solve your issue, unless there's a reason you can't use that build. http://downloads.activestate.com/ActivePerl/Windows/5.6/Active Perl-5.6.1 .638-MSWin32-x86.msi If you disable Friendly Errors in your browser, you'll see something about ASP telling you it can't SetScriptState properly (there are a few bugs listed in the bug tracker for this problem). They tend
RE: Does PERL5LIB work under IIS?
I don't understand how environment variables and @INC play together on Win32. I have an IIS server (5.0 I believ), with a system environment variable PERL5LIB=c:/agdata/libperl Given a simple CGI script, run under IIS: print HTML; content-type: text/plain PERL5LIB=$ENV{PERL5LIB} HTML print inc=$_\n for @INC __END__ I get the following output: PERL5LIB=C:/agdata/libperl inc=C:/Perl/lib inc=C:/Perl/site/lib I don't think this is an IIS thing.. I don't have a PERL5LIB Environment Variable defined on my system at all. (ActivePerl 5.8.6 Build 811) However, you should be able to push the path to @INC from your script (I think it needs to be in a BEGIN block, but I'm not sure). I've never really found a need to include a path that is not in the normal Win32 paths since everything I do is via PPM (and it throws the module in the lib or site\lib folders -- PPM makes for easy installs and versioning) -- with the exception of Mail-SpamAssassin, and it installs to the site\lib folder as well. Good Luck. Steven I would have expected that the directory pointed to by PERL5LIB would be listed in the @INC array, but it's not (and a module that appears in said directory cannot be found). On a Unix machine, I get something like the following: % perl -I/tmp/libperl -le 'print for @INC' /tmp/libperl /usr/local/lib/perl5/site_perl/5.8.6/mach /usr/local/lib/perl5/site_perl/5.8.6 /usr/local/lib/perl5/site_perl/5.8.3 /usr/local/lib/perl5/site_perl /usr/local/lib/perl5/5.8.6/mach /usr/local/lib/perl5/5.8.6 ___ Perl-Win32-Web mailing list Perl-Win32-Web@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Does PERL5LIB work under IIS?
-Original Message- From: David Landgren [mailto:[EMAIL PROTECTED] Sent: Friday, January 20, 2006 9:32 AM To: Steven Manross Cc: perl-win32-web@listserv.ActiveState.com Subject: Re: Does PERL5LIB work under IIS? Steven Manross wrote: I don't understand how environment variables and @INC play together on Win32. I have an IIS server (5.0 I believ), with a system environment variable PERL5LIB=c:/agdata/libperl Given a simple CGI script, run under IIS: print HTML; content-type: text/plain PERL5LIB=$ENV{PERL5LIB} HTML print inc=$_\n for @INC __END__ I get the following output: PERL5LIB=C:/agdata/libperl inc=C:/Perl/lib inc=C:/Perl/site/lib I don't think this is an IIS thing.. I don't have a PERL5LIB Environment Variable defined on my system at all. (ActivePerl 5.8.6 Build 811) However, you should be able to push the path to @INC from your script (I think it needs to be in a BEGIN block, but I'm not sure). I've never really found a need to include a path that is not in the normal Win32 paths since everything I do is via PPM (and it throws the module in the lib or site\lib folders -- PPM makes for easy installs and versioning) -- with the exception of Mail-SpamAssassin, and it installs to the site\lib folder as well. Good Luck. Pushing directories to @INC is trivial. I currently have the following awfulhak to make this work: BEGIN { my ($lib) = ($ENV{PERL5LIB} =~ m{^([cd]:(?:/\w+)+)$}i); push @INC, $lib; } But the thing is I *don't* want to have to do that to each and every web script, it's too painful. Maybe I should explain the end goal. I have three seperate Win32 boxes. I have a Perl search directory for in-house modules which, for historical reasons, is in different directories on different drives for the three machines. PERL5LIB lets me abstract that difference away. (And hopefully one day bring them back into line). You are probably looking for Config.pm (look at c:\perl\bin\config.pl as well).. I've not used it myself, but there's html and POD docs on them for their use, but I think you'd want to look at modifying these values (to supply your additional library paths): installvendorarch installvendorlib In the Config.pm Good luck. Steven So I have standard Activestate Perl installations (albeit with ppm additions) sitting in one place, and my in-house modules in a completely different directory. This allows me keep the AS stuff and my stuff completely separate. And the way the house works, it's just better that way. For command line programs, this works as advertised: C:\Documents and Settings\Administratorperl -le print for @INC C:/agdata/libperl c:/Perl/lib c:/Perl/site/lib . It does not work for IIS, and I wish it did. If there's another way of pushing stuff onto @INC, like editing a sekret file hidden away in c:/perl/.../ I'd settle for that. David -- It's overkill of course, but you can never have too much overkill. ___ Perl-Win32-Web mailing list Perl-Win32-Web@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: ASP Error with Perl 5.8 on IIS 6.0
FYI I wasn't talking about a page timeout... I was talking about a worker process timeout (which is set to 20 minutes by default -- it's part of Application Pools/Web Gardens). I've seen the 0240 in Redirects and also in pages that don't use redirects, but do instantiate a particular COM object. Example of COM object prob -- this uses 3 pages.. The combo page, one VB page and an identically styled perl page. http://www.manross.net/charts/chart-combined.asp Side-by-side VB and perl charts/graphs -- the charth is drawn dynamically by the COM object into a PNG file. Steven -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Herbert, Mark Sent: Wednesday, October 12, 2005 9:40 AM To: perl-win32-web@listserv.ActiveState.com Subject: RE: ASP Error with Perl 5.8 on IIS 6.0 Redirects is where I first saw the problem, but it doesn't require redirects or transers. The example I uploaded with the bug report is an ASP page that sends a completed HTML page to the client and finishes. On the client side, javascript does a delay then sets the window location to the same ASP page. The server bombs on the next call. It cleanly finishes servering the page, but it isn't ready for an identical request coming in, even minutes later after the page timeout. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Steven Manross Sent: Wednesday, October 12, 2005 5:28 PM To: Allegakoen, Justin Devanandan; perl-win32-web@listserv.ActiveState.com Subject: RE: ASP Error with Perl 5.8 on IIS 6.0 I'd agree as well.. VB (although ugly), seems a more stable platform for ASP in the last few years. I check bugzilla logs every couple months hoping someone has found a resolution for 5.8 or a new build has fixed it, but nothing is moving on this issue -- That I can see. For anyone listening that can do anything about it, I'd be happy to provide a test II6 6 webserver and malfunctioning ASP pages if needed to debug the issue(s). :) The one thing that I see is that you can mask the issue if you set your Application Pool Web Garden Maximum Number of worker Processes (-Performance tab on the Application Pool Properties Page) higher (defaults to 1 -- setting it to 5 masks the problem to display after 5 hits to the ASP page) .. It's still an issue, but the problemed Redirect / COM Object usage only throws the '0240' Exception after the 5th time (for 5 times) instead of every other time and get recycled every x minutes (maybe before another user hits it). I mention this because it's a symptom of the overall problem, not a fix -- hopefully useful to someone that can fix it. P.S. I'm currently getting the '0240' while creating a COM object (COM graphing tool) as well as on Redirects to 3 different servers $Server-Transfer(); blows chunks as well. Steven -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Allegakoen, Justin Devanandan Sent: Tuesday, October 11, 2005 5:01 PM To: perl-win32-web@listserv.ActiveState.com Subject: RE: ASP Error with Perl 5.8 on IIS 6.0 -8-- I have two asp applications that run with strict and warnings and produce no errors or warnings, just the following: Active Server Pages error 'ASP 0240' Script Engine Exception A ScriptEngine threw exception 'C005' in 'IActiveScript::SetScriptState()' from 'CActiveScriptEngine::ReuseEngine()' Perl 5.6 works fine - it seems to be just 5.8 on IIS 6.0. I need to do some enhancement on a couple of asp/perl apps, but there is no point in going any further with perl if this cannot be resolved. Can anybody add anything that might help? -8-- Mark, Not goimg to add anything that will help, but echoing the problem since AS are remarkbly quiet on this issue. I gave up with 5.8. On my machine I got the ASP 0240 error with just this:- %@ Language=PerlScript % HTML HEAD LINK rel=stylesheet type=text/css href=Misc.css /HEAD BODY bgColor=black /BODY /HTML However in this instance I copied an existing asp and renamed the file to LuckyDraw.asp and ran it with the localhost URL. I was going spare, but remembered the redirect episode and reinstalled Perl to 5.6. There is a definite problem with 5.8, I for one would like to hear from AS what progress has been made with the bug fix. Cheers Just in ___ Perl-Win32-Web mailing list Perl-Win32-Web@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs ___ Perl-Win32-Web mailing list Perl-Win32-Web@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs ___ Perl-Win32-Web mailing list Perl-Win32-Web@listserv.ActiveState.com To unsubscribe: http
RE: Open IE and fill out a Web-Form
Sorry for the late reply.. IE is a duanting task to automate at first (It took me a couple months to just get started beyond a simple navigate to feel comfortable in it), but once you understand the object model, it's pretty easy to automate. What you're asking to do is rather easy.. I'll give this sample for what it's worth -- since I am currently looking for non-contract work, I figure this sample is appropriate. :) Cheers to anyone it helps. Yes, it doesn't fill any listboxes, but they are rather easy to do as well once you understand the find_tag function. Here's a link to the IE development manuals... For after digesting the functions code (and wanting more) -- shouldn't take you too long. http://msdn.microsoft.com/workshop/index/default.asp I'm in the middle of re-developing the InternetExplorer-Window module and adding the functions.pm -- so you won't be able to find it on the net.. The PMs are attached. Please give positive/negative feedback if you are interested in this subject and/or just want to. :) Steven -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: Monday, July 25, 2005 9:44 PM To: perl-win32-web@listserv.ActiveState.com Subject: Open IE and fill out a Web-Form Hi everybody, I would have to open an IE window, open a URL, login to some server that makes heavy use of JavaScript, wait for feedback and then fill out a form that has all kinds of controls (text boxes, drop down boxes, buttons, etc). Does anybody know a short HowTo or some simple sample code instead of monstrous man-pages? It seems not to be THAT simple (as usual with perl). Thanks everybody, Peter ___ Perl-Win32-Web mailing list Perl-Win32-Web@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs sample.pl Description: sample.pl Window.pm Description: Window.pm Functions.pm Description: Functions.pm ___ Perl-Win32-Web mailing list Perl-Win32-Web@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Perl ISAPI Configuration For IIS 6.0 on Win 2003
When you say, ISAPI mode, are you meaning in ASP as a SCRIPT LANGUAGE = PerlScript? If so, you need to turn on ASP in IIS. In Server 2003 it's disabled by default. HTH Steven -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Bryan M. Kramer Sent: Tuesday, May 17, 2005 12:57 PM To: [EMAIL PROTECTED] Subject: Perl ISAPI Configuration For IIS 6.0 on Win 2003 I cannot seem to find any information about how to get Perl ISAPI to work on IIS 6.0. I have configured a server extension for perlis.dll. I have mapped .pl to perlis.dll for my web application. I'm still getting 404 errors and the like. After a lot of searching, I have gotten perl.exe to work in cgi mode. It is the ISAPI mode I'd like to try now. BTW Is there any documentation available? I've been searching without luck all afternoon. Any pointers would be greatly appreciated. Thanks Bryan M. Kramer ___ Perl-Win32-Web mailing list Perl-Win32-Web@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs ___ Perl-Win32-Web mailing list Perl-Win32-Web@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Persits IIS component ASPGrid
Variant is your friend... Know it, Love it, Use it! It's a pain sometimes to determine what to use for the type of variant, but trial and error usually works too.. :) You also had a usage issue (cursor needs to be before the open), and you should use error trapping for OLE errors, like below, but better.. Cheers! Steven % use Win32::OLE; use Win32::OLE::Variant; $strConnect = 'DRIVER={Microsoft Access Driver (*.mdb)};DBQ=' .$Server-MapPath('/aspgrid/db/aspgrid.mdb'); $Grid = $Server-CreateObject('Persits.Grid'); $Conn = $Server-CreateObject('ADODB.Connection'); $Conn-Open($strConnect); $RecSet = $Server-CreateObject('ADODB.Recordset'); $RecSet-{CursorLocation} = 3; $RecSet-Open('select id, name, phone from departments', $Conn, 2, 3); $this = Variant(VT_BYREF|VT_VARIANT,$RecSet); $Grid-{Recordset} = $this; if (Win32::OLE-LastError() != 0) { $Response-Write(Help\n.Win32::OLE-LastError()); exit 0; } $Grid-Cols('id')-{Hidden} = 1; $Grid-{ImagePath} = '/aspgrid/images/'; $Grid-Display(); $Grid-Disconnect(); $Grid = undef; $Conn = undef; % -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Carl Ringwall Sent: Thursday, March 10, 2005 3:19 PM To: 'perl-win32-web@listserv.ActiveState.com' Subject: Persits IIS component ASPGrid I'm having a bit of trouble with Persits ASPGrid, the documentation has this bit of VBScript code: Begin VBS __ ' Build connection string to aspgrid.mdb strConnect = DRIVER={Microsoft Access Driver (*.mdb)};DBQ= Server.MapPath(..\db\aspgrid.mdb) ' Create an instance of AspGrid Set Grid = Server.CreateObject(Persits.Grid) ' Create ADO Connection Set Conn = Server.CreateObject(ADODB.Connection) Conn.Open strConnect ' Create Recordset Set RecSet = Server.CreateObject(ADODB.Recordset) RecSet.CursorLocation = 3 ' adUseClient RecSet.Open select id, name, phone from departments, Conn, 2, 3 ' Pass external connection object to grid Grid.Recordset = RecSet ' Hide identity column Grid.Cols(id).Hidden = True ' Specify location of button images Grid.ImagePath = ../images/ ' Display grid Grid.Display ' Disconnect Grid.Disconnect ' Destroy Grid object Set Grid = Nothing Set Conn = Nothing ___ End VBS Here is my PerlScript Equivalent: Begin PerlScript __ $strConnect = 'DRIVER={Microsoft Access Driver (*.mdb)};DBQ=' . $Server-MapPath('..\\db\\aspgrid.mdb'); $Grid = $Server-CreateObject('Persits.Grid'); $Conn = $Server-CreateObject('ADODB.Connection'); $Conn-Open($strConnect); $RecSet = $Server-CreateObject('ADODB.Recordset'); $RecSet-Open('select id, name, phone from departments', $Conn, 2, 3); $RecSet-{CursorLocation} = 3; $Grid-{Recordset} = $RecSet; #line 25 is the next line $Grid-Cols('id')-{Hidden} = 1; $Grid-{ImagePath} = '../images/'; $Grid-Display(); $Grid-Disconnect(); $Grid = undef; $Conn = undef; ___ End PerlScript I'm getting this error in the browser: PerlScript Error (0x80004005) (in cleanup) Can't use an undefined value as a HASH reference /aspgrid/02_first/_ts3tmp.asp, line 25 is noted in the code. Any syntax problems that anyone can see? I'm stuck. ___ Perl-Win32-Web mailing list Perl-Win32-Web@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs ___ Perl-Win32-Web mailing list Perl-Win32-Web@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: LWP and authentication not working with IIS
There's an Auth::NTLM module that works as a plug-in in LWP... It should be very straight-forward.. If not, I'll try to find some dusty code to work with it.. The only catch is that there are 2 Auth::NTLM modules.. I believe this is the one you need... http://search.cpan.org/~umvue/Authen-NTLM-0.31/lib/Authen/NTLM.pm Steven -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Charles Pelkey Sent: Wednesday, August 25, 2004 6:56 PM To: [EMAIL PROTECTED] Subject: Re: LWP and authentication not working with IIS Has anyone actually got this working? How about with IIS6 and Windows Server 2003? I tried to implement this into a web spider that searches our internal site that uses Integrated Windows Authentication and it always fails using the documented implementation. V/r, Charles - Original Message - From: Paul O'Russa [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, January 09, 2003 1:12 PM Subject: RE: LWP and authentication not working with IIS I'm already using Basic authentication. I went to look for that NTLM module anyway and found an example of how to use it. It showed a sample of how to use the credentials() method, which, as it turns out, I was not passing correct parameters to. :-) The first parameter must have a :80 at the end of it or it won't work properly: $ua-credentials('www.somewhere.com:80', 'www.somewhere.com', 'username', 'password'); Doh! Thanks for your help... Paul Thomas_M [EMAIL PROTECTED] 1/9/2003 9:18:53 AM I believe Windows requires NTLM authentication (aka Windows Challenge/Response) to access NTFS protected directories. LWP uses Basic authentication by default, so that's why it didn't work. You could either (1) Configure IIS to protect the pages using Basic authentication instead of using Windows security settings, or (2) Configure LWP to perform NTLM authentication (try the LWP::Authen::NTLM module). - Mark. -- Mark Thomas[EMAIL PROTECTED] Internet Systems Architect User Technology Associates, Inc. $_=q;KvtuyboopuifeyQQfeemyibdlfee;; y.e.s. ;y+B-x+A-w+s; ;y;y; ;;print;; -Original Message- From: Paul O'Russa [mailto:[EMAIL PROTECTED] Sent: Thursday, January 09, 2003 11:40 AM To: [EMAIL PROTECTED] Subject: LWP and authentication not working with IIS I have been trying to find a good way to verify a user's username and password via Perl on Windows 2000 using IIS. What I've done is setup a web page that is protected via Windows security settings (i.e. NTFS) and then try using LWP to retrieve that page, passing in the credentials. Like this below (url's, username, and password changed to protect the innocent): --- use LWP; my $ua = LWP::UserAgent-new; $ua-credentials('www.somewhere.com', 'www.somewhere.com', 'username', 'password'); my $url = 'http://www.somewhere.com/dir/securepage.asp'; my $response = $ua-get($url); print Error: . $response-header('WWW-Authenticate') . \n . 'Error accessing' . \n . $response-status_line . \n . at |$url| unless $response-is_success; --- But the authentication does not appear to work. I get this for output: Error: Basic realm=www.somewhere.com Error accessing 401 Unauthorized at |http://www.somewhere.com/dir/securepage.asp| If I change the URL to point to a page that is available anonymously, it works fine. If I access that same URL via a web browser and log in manually using the same username/password I get in just fine. Can anyone explain what I am doing wrong, or what I should be doing to make it work? Thank you, Paul O'Russa ___ Perl-Win32-Web mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs ___ Perl-Win32-Web mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs ___ Perl-Win32-Web mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs ___ Perl-Win32-Web mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: ASP Error with Perl 5.8 on IIS 6.0
Just a note on this since I've further worked through this problem.. It seems that replacing the Redirect with the following code: $Server-Transfer('newpage.asp'); return 1; ...gets around whatever issue that the Redirect has... So it would seem that Redirect is somewhat broken in Perl 5.8.x? Also since there seem to be performance benefits to using the Transfer method (i.e. no roundtrip back to the browser to inform about the redirect), it seems that I'll be happier with the solution even though Redirect isn't fixed.. :) Steven -Original Message- From: Herbert, Mark [mailto:[EMAIL PROTECTED] Sent: Thursday, July 08, 2004 12:11 AM To: '[EMAIL PROTECTED]' Cc: Steven Manross Subject: RE: ASP Error with Perl 5.8 on IIS 6.0 -Original Message- From: Steven Manross [mailto:[EMAIL PROTECTED] Sent: Thursday, July 08, 2004 2:06 AM To: [EMAIL PROTECTED] Subject: ASP Error with Perl 5.8 on IIS 6.0 Sorry not to continue the thread from a couple weeks ago by Paul O'Russa, but... I haven't subscribed to THIS activestate list until now... That was back in January, and it was a thread that I started. I updated recently to 5.8.4.810 and found it had no effect on the problem. Paul O'Russa found that it worked in IIS6 if he reinstalled perl 5.6.1. I rewrote the problem area to avoid redirects, but I still get the error once in a while. At least now the user can refresh the browser and then it works. Perhaps somebody will think of something if I describe the application. The app has two frames: a menu frame and a main frame. The user clicks on menu items in one frame, which open asp pages in the main frame. The error occurs when the user ends the appilcation. In this case, a javascript function asks the user to verify that the app should be terminated, and if so, then it executes the following: window.top.location.href = form_main_logout.asp; On the client side, the frames are removed, then this error message is displayed: Active Server Pages error 'ASP 0240' Script Engine Exception /PMV/form_main_logout.asp A ScriptEngine threw exception 'C005' in 'IActiveScript::SetScriptState()' from 'CActiveScriptEngine::ReuseEngine()'. The user can refresh the page, and the form_main_logout.asp page executes correctly. My first menu version worked a little different. It did a lot of redirects. That did not work at all with perl 5.8 (same error message almost every time it did a redirect). Now I have only this one problem when the user logs out. If anybody else has this error, what other operations, or app configurations, can cause it? The error WE are getting seems to relate to a value set in the Application Pool settings... Namely, in the performance Tab, under WebGarden, the Maximum Number of worker processes seems to control how ofter this error comes up... This is by no means a fix (and I am tending to call it a BUG but can't say for sure), but I can now go to this page 5 times without seeing the error you've referenced (since I set the max to 5) Active Server Pages error 'ASP 0240' Script Engine Exception A ScriptEngine threw exception 'C005' in 'IActiveScript::SetScriptState()' from 'CActiveScriptEngine::ReuseEngine()' ... but then I get the error 5 times when I refresh a page and suddenly, voila no more error for 5 more times. This is a default IIS 6 install, Perl 5.8.4.810, and a few misc PPMs. I am using Win32::OLE and Win32::Const for use of ADODB.Command and ADODB.Connection objects that reference a SQL Server for stored proc calls (as well as another 3rd party COM application). The page generating this error is the most benign of all the 4 pages in this application and it simply looks to see if cookies are enabled, if a cookie exists, and then asks the user to login if it doesn't.. or redirects them to another page if it does Steven CODE %@ LANGUAGE = PerlScript% % if ($Request-Cookies(lookimacookie)-{Item} ne ) { $Response-Redirect('myotherpage.asp'); } else { $Response-Write( -- Please login.BR\n); } % HTML BODY % use Win32::OLE; $bc = Win32::OLE-new(MSWC.BrowserType); if ($bc-{cookies} == 0) { $Response-Write(Your browser doesn't seem to support cookies. :(BR\n); } else { } % FORM ACTION=login_verify.asp METHOD=POST NAME=LOGIN TABLE TR TD Username: /TD TD input type=text value= name=user size=20 /TD /TR TR TD Password: /TD TD input type=password value= name=pw size=20 /TD /TR TR TD /TD TD input type=submit value=Login name=SUBMIT size=20 /TD /TR /TABLE /FORM /BODY /HTML ___ Perl-Win32-Web mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com
RE: Using Perl from IIS to enable and disable accounts.
Note prepended with SM-- -Original Message- From: Michael H. Martel [mailto:[EMAIL PROTECTED] Sent: Friday, July 09, 2004 12:22 PM To: Steven Manross; Spitzer, Robert L. (Newport News); [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: RE: Using Perl from IIS to enable and disable accounts. --On Friday, July 9, 2004 9:15 AM -0700 Steven Manross [EMAIL PROTECTED] wrote: The local admin or Domain admin? If local (and IIS is not on a DC) then yes, that may be your problem, Because the local admin won't have access (what's the error you are getting.. That'll tell us right away. 0x80070005 ??? -- I think that's Access denied...) If I use Integrated Authentication and login as a Domain/Enterprise Admin then yes my code works fine. However. I want to be able to give non Admin users access to this website, so that they can perform SOME administrative type things. Hence why I want to be able to pass alternative credentials to the Activew Directory Bind. That way they can login as themselves, and then run this web script as a domain/Enterprise Admin. SM--Then put the users you want to do this stuff in the Account Operators Group or delegate this perm to some group that those users belong and your code should work fine. -check the NTFS perms on the IIS pages to make sure they have access. I'll check all these out when I'm back on Monday. Thanks! Michael -- o- Michael H. Martel | Vermont State Colleges [EMAIL PROTECTED] | Systems Administrator http://probe.vsc.edu/~michael | PH:802-241-2544 FX:802-241-3363 ___ Perl-Win32-Web mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
ASP Error with Perl 5.8 on IIS 6.0
Sorry not to continue the thread from a couple weeks ago by Paul O'Russa, but... I haven't subscribed to THIS activestate list until now... The error WE are getting seems to relate to a value set in the Application Pool settings... Namely, in the performance Tab, under WebGarden, the Maximum Number of worker processes seems to control how ofter this error comes up... This is by no means a fix (and I am tending to call it a BUG but can't say for sure), but I can now go to this page 5 times without seeing the error you've referenced (since I set the max to 5) Active Server Pages error 'ASP 0240' Script Engine Exception A ScriptEngine threw exception 'C005' in 'IActiveScript::SetScriptState()' from 'CActiveScriptEngine::ReuseEngine()' ... but then I get the error 5 times when I refresh a page and suddenly, voila no more error for 5 more times. This is a default IIS 6 install, Perl 5.8.4.810, and a few misc PPMs. I am using Win32::OLE and Win32::Const for use of ADODB.Command and ADODB.Connection objects that reference a SQL Server for stored proc calls (as well as another 3rd party COM application). The page generating this error is the most benign of all the 4 pages in this application and it simply looks to see if cookies are enabled, if a cookie exists, and then asks the user to login if it doesn't.. or redirects them to another page if it does Steven CODE %@ LANGUAGE = PerlScript% % if ($Request-Cookies(lookimacookie)-{Item} ne ) { $Response-Redirect('myotherpage.asp'); } else { $Response-Write( -- Please login.BR\n); } % HTML BODY % use Win32::OLE; $bc = Win32::OLE-new(MSWC.BrowserType); if ($bc-{cookies} == 0) { $Response-Write(Your browser doesn't seem to support cookies. :(BR\n); } else { } % FORM ACTION=login_verify.asp METHOD=POST NAME=LOGIN TABLE TR TD Username: /TD TD input type=text value= name=user size=20 /TD /TR TR TD Password: /TD TD input type=password value= name=pw size=20 /TD /TR TR TD /TD TD input type=submit value=Login name=SUBMIT size=20 /TD /TR /TABLE /FORM /BODY /HTML ___ Perl-Win32-Web mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
opening file located in an IIS virtual directory
Using IIS 5 with NT4 and W2K IE 5.x clients I've tried opening the file on a remote machine via CGI a couple different ways but almost always seem to have issues... My latest solution has faired no better, that being an IIS virtual Directory that points to the UNC path of an object.. Directory browsing of the virtual dir works fine, and I can also view the file once in the virtual dir, but not via perl with the directories that I think I should be querying... i.e. http://iisserver/data/system-name/state.sah where: -data is a directory on the IIS Server -system-name is a virtual directory on the IIS Server pointing to a UNC resource. -state.sah is a plain-text file in the UNC resource. the error I get using use CGI::Carp qw(fatalsToBrowser) is: data/system-name/state.sah --- No such file or directory at d:\Shared\www\cgi-bin\seti.pl line 80. This would tend to make sense because the file is not located on the IIS Server, but I guess my question is really how do I get perl to understand that data\system-name is a virtual directory.. Code: #snip foreach $system (sort {lc($a) cmp lc($b)} keys %Systems) { foreach $file (@files) { $file_string = data/$system/$file; print $file_string\nBR; if (!open (FILE,$file_string)) { die $file_string --- $!; } else { print Woohoo! \n; foreach $line (FILE) { #do something } } } } #snip _ Get your FREE download of MSN Explorer at http://explorer.msn.com ___ Perl-Win32-Web mailing list [EMAIL PROTECTED] http://listserv.ActiveState.com/mailman/listinfo/perl-win32-web