----- Original Message ----- From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Saturday, December 04, 2004 9:05 PM Subject: ActivePerl Digest, Vol 11, Issue 8
| Send ActivePerl mailing list submissions to | [EMAIL PROTECTED] | | To subscribe or unsubscribe via the World Wide Web, visit | http://listserv.ActiveState.com/mailman/listinfo/activeperl | or, via email, send a message with subject or body 'help' to | [EMAIL PROTECTED] | | You can reach the person managing the list at | [EMAIL PROTECTED] | | When replying, please edit your Subject line so it is more specific | than "Re: Contents of ActivePerl digest..." | | | Today's Topics: | | 1. Win32::ClipBoard WaitForChange with LWP::UserAgent->new() | (Allison, Jason (JALLISON)) | 2. perl pdf viewing (Gardner, Sam) | 3. Re: Win32::ClipBoard WaitForChange with LWP::UserAgent->new() | ($Bill Luebkert) | 4. Perl Script Under Apache Gets Error (MikeA) | 5. Re: OLE Browser in Active Perl (renard) | 6. Re: Perl Script Under Apache Gets Error ($Bill Luebkert) | | | ---------------------------------------------------------------------- | | Message: 1 | Date: Fri, 3 Dec 2004 15:41:42 -0500 | From: "Allison, Jason \(JALLISON\)" <[EMAIL PROTECTED]> | Subject: Win32::ClipBoard WaitForChange with LWP::UserAgent->new() | To: <[EMAIL PROTECTED]> | Message-ID: | <[EMAIL PROTECTED]> | Content-Type: text/plain; charset="us-ascii" | | Hello all, | | -- This is perl, v5.8.4 built for MSWin32-x86-multi-thread -- Win2k | Professional | | Im trying to shortcut an intranet web lookup using the Win32::ClipBoard | module. The unusualness of this not working is the first iteration into | the loop/WaitForChange works, but it doesn't work for susequent changes, | which makes no sense. My original thoughts were along the lines of | improperly scoped LWP of HTTP variables, but I just don't see it. In | addition, I use this code w/in a module using Tk as a front-end and it | works fine (sans Win32::Clipboard). | | Below is made my best basic bug statement. The code below obviosly has | no valid use except to show my point. The code below when run will | determine when there is a change to the Win32 ClipBoard and paste the | google content into the clipboard and then wait for another change. | When run, the code will recognize the first change to the ClipBoard, but | not subsequent. | | Let me also add that the second code snippet takes out the LWP/HTTP all | together and it works, however, I see some obscure "race condition" | sitautions if I don't put the sleep in there. For example, the app will | work, but I will get 2 or 3 "change"'s per copy into a clipboard | | Any ideas? | | Thanks, | Jason | | [code] | #!/usr/bin/perl | | use strict; | | use LWP; | use HTML::Parse; | use Win32::Clipboard; | | my $clip = Win32::Clipboard("cross-refernce"); | $clip->WaitForChange(); | | for (;;) { | | $clip->WaitForChange(); | print "change\n"; | set_clipboard($clip->GetText()); | | } | | sub set_clipboard() { | my ($number) = @_; | | my $browser = LWP::UserAgent->new(); | | # Create a request | my $url = "http://www.google.com"; | | my $req = new HTTP::Request GET => $url; | | my $response = $browser->request($req); | | my $html = $response->content; | | $clip->Set($html); | | } | __END__ | [/code] | | [code] | #!/usr/bin/perl | | use strict; | | use Win32::Clipboard; | | my $clip = Win32::Clipboard("cross-refernce"); | $clip->WaitForChange(); | | for (;;) { | | $clip->WaitForChange(); | print "change\n"; | set_clipboard($clip->GetText()); | | } | | sub set_clipboard() { | | $clip->Set("I love Perl"); | #sleep 5; | | } | __END__ | [/code] | | | | ------------------------------ | | Message: 2 | Date: Fri, 3 Dec 2004 19:28:09 -0500 | From: "Gardner, Sam" <[EMAIL PROTECTED]> | Subject: perl pdf viewing | To: "'[EMAIL PROTECTED]'" | <[EMAIL PROTECTED]> | Message-ID: | <[EMAIL PROTECTED]> | Content-Type: text/plain; charset="us-ascii" | | Direct pdf viewing can be a tricky topic. Assuming all I need to do is | extract text, does anyone have some recommendations on simple ways to do | this via perl? | -------------------------- | Sent from my BlackBerry Wireless Handheld | | This communication is confidential and is intended solely for the addressee. | It is not to be forwarded to any other person or copied without the | permission of the sender. Please notify the sender in the event you have | received this communication in error. This communication is not an offer to | sell or a solicitation of an offer to buy any securities discussed herein. | Keefe, Bruyette & Woods, Inc. makes no representation as to the accuracy or | completeness of information contained in this communication. | -------------- next part -------------- | An HTML attachment was scrubbed... | URL: http://ASPN.ActiveState.com/ASPN/Mail/Browse/Threaded/activeperl/attachments/20041203/88e33067/attachment-0001.htm | | ------------------------------ | | Message: 3 | Date: Fri, 03 Dec 2004 17:09:53 -0800 | From: "$Bill Luebkert" <[EMAIL PROTECTED]> | Subject: Re: Win32::ClipBoard WaitForChange with LWP::UserAgent->new() | To: "Allison, Jason \(JALLISON\)" <[EMAIL PROTECTED]> | Cc: [EMAIL PROTECTED] | Message-ID: <[EMAIL PROTECTED]> | Content-Type: text/plain; charset=us-ascii | | Allison, Jason (JALLISON) wrote: | | > Hello all, | > | > -- This is perl, v5.8.4 built for MSWin32-x86-multi-thread -- Win2k | > Professional | > | > Im trying to shortcut an intranet web lookup using the Win32::ClipBoard | > module. The unusualness of this not working is the first iteration into | > the loop/WaitForChange works, but it doesn't work for susequent changes, | > which makes no sense. My original thoughts were along the lines of | > improperly scoped LWP of HTTP variables, but I just don't see it. In | > addition, I use this code w/in a module using Tk as a front-end and it | > works fine (sans Win32::Clipboard). | > | > Below is made my best basic bug statement. The code below obviosly has | > no valid use except to show my point. The code below when run will | > determine when there is a change to the Win32 ClipBoard and paste the | > google content into the clipboard and then wait for another change. | > When run, the code will recognize the first change to the ClipBoard, but | > not subsequent. | > | > Let me also add that the second code snippet takes out the LWP/HTTP all | > together and it works, however, I see some obscure "race condition" | > sitautions if I don't put the sleep in there. For example, the app will | > work, but I will get 2 or 3 "change"'s per copy into a clipboard | > | > Any ideas? | | It appears to be really screwed up. Polling should work : | | use strict; | | use LWP; | use HTML::Parse; | use Win32::Clipboard; | | my $prev = 'cross-reference'; | my $clip = Win32::Clipboard ($prev) or die "new clipboard: $! ($^E)"; | | while (1) { | sleep 5; | my $is = $clip->GetText(); | next if $is eq $prev; | print "clipboard change\n"; | print "is='$is'\n"; | set_clipboard (); | } | | sub set_clipboard { | | my $ua = LWP::UserAgent->new(); | my $url = "http://www.google.com"; | my $req = new HTTP::Request GET => $url; | my $response = $ua->request($req); | my $html = $response->content; | $clip->Set($html); | $prev = $html; | | } | | __END__ | | | -- | ,-/- __ _ _ $Bill Luebkert Mailto:[EMAIL PROTECTED] | (_/ / ) // // DBE Collectibles Mailto:[EMAIL PROTECTED] | / ) /--< o // // Castle of Medieval Myth & Magic http://www.todbe.com/ | -/-' /___/_<_</_</_ http://dbecoll.tripod.com/ (My Perl/Lakers stuff) | | | ------------------------------ | | Message: 4 | Date: Fri, 3 Dec 2004 21:03:33 -0500 | From: "MikeA" <[EMAIL PROTECTED]> | Subject: Perl Script Under Apache Gets Error | To: [EMAIL PROTECTED] | Message-ID: <[EMAIL PROTECTED]> | | Environment | ========= | WinXP Pro SP2 | Active State Perl 5.0.8 | | | Browser Message | ============ | The server encountered an internal error or misconfiguration and was unable | to complete your request. | Please contact the server administrator and inform them of the time the | error occurred, and anything you might have done that may have caused the | error. | More information about this error may be available in the server error log. | | | Apache Error Log | ============ | Nothing | | | Apache Access Log | ============== | 127.0.0.1 - - [03/Dec/2004:20:29:28 -0500] "GET | /cgi-bin/awstats.pl?update&config=localhost&update=1 HTTP/1.1" 500 625 | "http://127.0.0.1/awstats/index.html" "Mozilla/5.0 (Windows; U; Windows NT | 5.1; en-US; rv:1.7.2) Gecko/20040804 Netscape/7.2 (ax)" | | | Apache httpd.conf | ============= | | ScriptAlias cgi-bin/ "E:/ApacheGroup/Apache2/html/cgi-bin/" | <Directory "E:/ApacheGroup/Apache2/html/cgi-bin/"> | AllowOverride None | Options None ExecCGI | Order allow,deny | Allow from all | </Directory> | | | AddHandler cgi-script .pl | ScriptAlias /perl "d:/perl" | AddType application/x-httpd-pl .pl | Action application/x-httpd-pl "/perl/bin/perl.exe " | | | Although I am sure that I set the registry to find Perl, I also set the ! in | the .pl file | | awstats.pl | ========== | #!/perl | | | The error occurs when I click on the update tag to update the stats and then | display them in AWStats. The web page is in awstats/index.html. | | I appreciate any help. | | Thanks. | | Mike | | | | | | ------------------------------ | | Message: 5 | Date: Fri, 03 Dec 2004 21:29:20 -0500 | From: renard <[EMAIL PROTECTED]> | Subject: Re: OLE Browser in Active Perl | To: Jan Dubois <[EMAIL PROTECTED]> | Cc: [EMAIL PROTECTED] | Message-ID: <[EMAIL PROTECTED]> | Content-Type: text/plain; charset=ISO-8859-1; format=flowed | | Thank you for your reply. | | I did try the 2 solutions found | http://bugs/activestate.com/show_bug?id=34875. | | Both worked. I have settled on the solution suggested by Steve | Woestemeyer. With his solution, I do get a dialog box asking if I want | to run the script. | | I still have some problem with the win32::OLE Browser when working with | Microsoft Excel section. | | 1. The library icon for Microsoft Excel 5.0 points to non-existent help | file. | 2. The library icon for Microsoft Excell 11.0 responds intermittenlty. | 3. links to gif images that point to e-mail address ... example: | expandtri.gif has offline source reference. | 4. When I clicked on a link with a page, I get a dialog box that in | part reads as follows: | | ---------------- | Line: 17 | Char: 1 | Error: Not implemented | Code: 0 | URL mk:@MSIStore::C:\Program Files\Microsoft | Office\OFFICE11\VBAXL10.CHM::/links/xlobjBorder1_l.htm | -------------------- | the last part of the URL differs per link selected. | | I realize that the error lies within the Microsoft Office help file and | not with Browser.dhtml or Browser.html files. I was wandering if any | one knows where I could obtain | correct help files. | | The help file Microsoft Word 11 has the same problems as described above. | | Once again, thank you for your help in getting OLE Browser to work again | on my machine. | | | | Jan Dubois wrote: | | >On Fri, 03 Dec 2004, renard wrote: | > | > | >>Is OLE Browser that comes with Active Perl broken? | >> | >>When I invoke the OLE Browser from within Active Perl online | >>documentation ( or clicking on OleBrowser.htm ) I get a browser window | >>with 5 panes. The first 4 panes are empty and the bottom pane lists | >>the contents of OleBrowser.dhtm. | >> | >>The first few lines are: | >>-------------- | >><HTML><!-- Hey Emacs, please edit in -*- perl -*- mode --> <!-- We | >>need some JScript until the PerlScript bugs are fixed. :-( --> | >><SCRIPT> | >>-------------- | >>I have googled and the only reference about a malfunction with OLE | >>Browser with ActivePerl is over 2 years and no response was given. | >> | >>Would appreciate if someone could enlighten me. | >> | >> | > | >It is a problem with Windows XP SP2. You can fix it yourself: | > | > http://bugs.activestate.com/show_bug.cgi?id=34875 | > | >Fix is at the very bottom of that page. | > | >Cheers, | >-Jan | > | > | >_______________________________________________ | >ActivePerl mailing list | >[EMAIL PROTECTED] | >To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs | > | > | > | > | | | ------------------------------ | | Message: 6 | Date: Fri, 03 Dec 2004 22:30:46 -0800 | From: "$Bill Luebkert" <[EMAIL PROTECTED]> | Subject: Re: Perl Script Under Apache Gets Error | To: MikeA <[EMAIL PROTECTED]> | Cc: [EMAIL PROTECTED] | Message-ID: <[EMAIL PROTECTED]> | Content-Type: text/plain; charset=us-ascii | | MikeA wrote: | > Environment | > ========= | > WinXP Pro SP2 | > Active State Perl 5.0.8 | > | > | > Browser Message | > ============ | > The server encountered an internal error or misconfiguration and was unable | > to complete your request. | > Please contact the server administrator and inform them of the time the | > error occurred, and anything you might have done that may have caused the | > error. | > More information about this error may be available in the server error log. | > | > | > Apache Error Log | > ============ | > Nothing | > | > | > Apache Access Log | > ============== | > 127.0.0.1 - - [03/Dec/2004:20:29:28 -0500] "GET | > /cgi-bin/awstats.pl?update&config=localhost&update=1 HTTP/1.1" 500 625 | > "http://127.0.0.1/awstats/index.html" "Mozilla/5.0 (Windows; U; Windows NT | > 5.1; en-US; rv:1.7.2) Gecko/20040804 Netscape/7.2 (ax)" | | You're getting a 500 error there, so you're getting an internal error | in the server. | | > Apache httpd.conf | > ============= | > | > ScriptAlias cgi-bin/ "E:/ApacheGroup/Apache2/html/cgi-bin/" | | Also try a / in front of cgi-bin/ | | > <Directory "E:/ApacheGroup/Apache2/html/cgi-bin/"> | > AllowOverride None | > Options None ExecCGI | > Order allow,deny | > Allow from all | > </Directory> | > | > | > AddHandler cgi-script .pl | > ScriptAlias /perl "d:/perl" | > AddType application/x-httpd-pl .pl | > Action application/x-httpd-pl "/perl/bin/perl.exe " | | Not sure about those last 3, but don't think they would hurt anything. | Try commenting them out. | | > Although I am sure that I set the registry to find Perl, I also set the ! in | > the .pl file | > | > awstats.pl | > ========== | > #!/perl | | Try using #!perl and make sure perl is in your path or use the full path to perl. | I don't think it's getting this far though. | | > The error occurs when I click on the update tag to update the stats and then | > display them in AWStats. The web page is in awstats/index.html. | | -- | ,-/- __ _ _ $Bill Luebkert Mailto:[EMAIL PROTECTED] | (_/ / ) // // DBE Collectibles Mailto:[EMAIL PROTECTED] | / ) /--< o // // Castle of Medieval Myth & Magic http://www.todbe.com/ | -/-' /___/_<_</_</_ http://dbecoll.tripod.com/ (My Perl/Lakers stuff) | | | ------------------------------ | | _______________________________________________ | ActivePerl mailing list | [EMAIL PROTECTED] | To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs | | End of ActivePerl Digest, Vol 11, Issue 8 | ***************************************** _______________________________________________ ActivePerl mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
