RE: Windows Registry
This one is a good web resource: http://www.winguides.com/registry/ Francis Paulin ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: Windows Registry
you should not be "hacking" anything "Hicks, Bob" <[EMAIL PROTECTED]> Sent by:To: [EMAIL PROTECTED] [EMAIL PROTECTED]cc: veState.com Subject: Windows Registry 01/14/2004 03:25 PM Is there a good web resource for "hacking" the registry on Windows? Robert Hicks ___ 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
Windows Registry
Is there a good web resource for "hacking" the registry on Windows? Robert Hicks ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Reading Mail from Exchange Folder
> -Original Message- > From: Richard DeWath [mailto:[EMAIL PROTECTED] > Subject: Reading Mail from Exchange Folder > I am just learning about this and need some pointers > on how I can write a Perl script that lets me read my > new mail on an Exchange server [assume the Inbox], > find mail with a fixed subject I am looking for, then > process the data, move the mail to a "read" folder. > Any good examples, pointers or books that will let me > do this using Activestate Perl for Windows? Assuming you have outlook, this should get you started: use strict; use Win32::OLE qw(in with); use Win32::OLE::Const 'Microsoft Outlook'; $Win32::OLE::Warn = 2; # Throw Errors, I'll catch them my $outfile = 'c:\perl\projects\improvdb\nahatemailssorted.txt'; my $OL = Win32::OLE->GetActiveObject('Outlook.Application') or die Win32::OLE->LastError(); my $NameSpace = $OL->GetNameSpace("MAPI"); my $Folder = $NameSpace->GetDefaultFolder(olFolderInbox); foreach my $msg (in $Folder->{Items}){ if ($msg->{Subject} =~ m//i) { #Here, there be move code } } Also, I wrote a tutorial on using Excel and Win32::OLE on perlmonks, but the beginning portion is applicable to all Win32::OLE use, and is worth the read. http://perlmonks.org/index.pl?node_id=153486 Otherwise, using Win32::MAPI would also be a choice. Chuck Charbeneau Lear Corporation Lead Software Applications Engineer ccharbeneau at lear dot com ** ** LEGAL DISCLAIMER ** ** This E-mail message and any attachments may contain legally privileged, confidential or proprietary information. If you are not the intended recipient(s), or the employee or agent responsible for delivery of this message to the intended recipient(s), you are hereby notified that any dissemination, distribution or copying of this E-mail message is strictly prohibited. If you have received this message in error, please immediately notify the sender and delete this E-mail message from your computer. ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Reading Mail from Exchange Folder
Look into CDO (Collaboration Data Objects). A good place to start is http://www.cdolive.com. -Original Message- From: Richard DeWath [mailto:[EMAIL PROTECTED] Sent: Wed 1/14/2004 5:55 AM To: [EMAIL PROTECTED] Cc: Subject: Reading Mail from Exchange Folder I am just learning about this and need some pointers on how I can write a Perl script that lets me read my new mail on an Exchange server [assume the Inbox], find mail with a fixed subject I am looking for, then process the data, move the mail to a "read" folder. Any good examples, pointers or books that will let me do this using Activestate Perl for Windows? Thanks, Richard __ Do you Yahoo!? Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes http://hotjobs.sweepstakes.yahoo.com/signingbonus ___ 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: Reading Mail from Exchange Folder
There are two basic ways to do this: MAPI and Outlook COM interface. TechNet has tons of information on how to write both types of code. MS shows Vbscript, of course, but it isn't too hard to convert to perl. Here's a snippet of MAPI to get you going: #Originally from Ben Hall #www.benhall.co.uk use strict; use Win32::OLE qw(in with OVERLOAD); # outlook profile my $sender = "Ken Cornetet 1"; my $passwd = ""; # your password here # # PROGRAM STARTS HERE # # Create a new MAPI Session # print "Initialising OLE & MAPI...\n"; Win32::OLE->Initialize(Win32::OLE::COINIT_OLEINITIALIZE); # needs this magic incantation my $session = Win32::OLE->new("MAPI.Session"); if(Win32::OLE->LastError() != 0) { die "Could not create a new MAPI Session: ", Win32::OLE->LastError(), "\n"; } # # Attempt to log on # print "Logging on to Exchange server...\n"; my $err = $session->Logon($sender, $passwd); if ($err) { die "Logon failed: $!"; } my $store = $session->InfoStores("Mailbox - Ken Cornetet"); my $folder = $store->RootFolder->Folders("Inbox"); print "Checking for messages...\n"; my $messages = $folder->Messages; my $message_count = $messages->Count; my $msg = ""; print "\nNumber of messages: ".$message_count."\n"; for( my $i=1 ; $i<=$message_count ; $i++) { if ($i == 1) { $msg = $messages->GetFirst(); } else { $msg = $messages->GetNext(); } print "From: ", $msg->{Sender}->{Address}, "\n"; } $session->Logoff(); # end of script -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Richard DeWath Sent: Wednesday, January 14, 2004 8:56 AM To: [EMAIL PROTECTED] Subject: Reading Mail from Exchange Folder I am just learning about this and need some pointers on how I can write a Perl script that lets me read my new mail on an Exchange server [assume the Inbox], find mail with a fixed subject I am looking for, then process the data, move the mail to a "read" folder. Any good examples, pointers or books that will let me do this using Activestate Perl for Windows? Thanks, Richard __ Do you Yahoo!? Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes http://hotjobs.sweepstakes.yahoo.com/signingbonus ___ 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: unable to catching signal
Hello du4mi, Wednesday, January 14, 2004, 6:11:17 AM, you wrote: dgd> but if I kill this process from another cmd window with dgd> perl -e "kill INT => xxx"; where xxx is pid of running test.exe dgd> signal is not catched and test.exe is ended. dgd> this behaviour with ABRT, HUP, QUIT etc The best you can hope for on Win32 is terminating the process/thread with a specified exit code. perlport says the following about kill: kill SIGNAL, LIST kill(0, LIST) is implemented for the sake of taint checking; use with other signals is unimplemented. (Mac OS) Not implemented, hence not useful for taint checking. (RISC OS) kill() doesn't have the semantics of raise(), i.e. it doesn't send a signal to the identified process like it does on Unix platforms. Instead kill($sig, $pid) terminates the process identified by $pid, and makes it exit immediately with exit status $sig. As in Unix, if $sig is 0 and the specified process exists, it returns true without actually terminating it. (Win32) -- Best regards, Sammailto:[EMAIL PROTECTED] ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
unable to catching signal
Hello All, A small script to testing signal handling in perl: #!perl -w $|=1; $SIG{INT} = sub {print "got signal\n"}; print $$; # print pid while(1){}; then I make exe with perl2exe/PAR/perlapp... and run it. Ctrl+C leads to "got signal" . It's fine. but if I kill this process from another cmd window with perl -e "kill INT => xxx"; where xxx is pid of running test.exe signal is not catched and test.exe is ended. this behaviour with ABRT, HUP, QUIT etc -- Best regards, ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Reading Mail from Exchange Folder
I am just learning about this and need some pointers on how I can write a Perl script that lets me read my new mail on an Exchange server [assume the Inbox], find mail with a fixed subject I am looking for, then process the data, move the mail to a "read" folder. Any good examples, pointers or books that will let me do this using Activestate Perl for Windows? Thanks, Richard __ Do you Yahoo!? Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes http://hotjobs.sweepstakes.yahoo.com/signingbonus ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Perlscript component crashes Outlook
Hi, I've created a Windows Script Component using the wizard and a script that I first developed as a regular Perl Script. When I instantiate the COM object from a VBScript everything works fine. If I do the same from a VBA procedure (from Outlook), Outlook will close without so much as a beep. As I don't know how to debug a Script Component I've tried putting in a Win32::MsgBox call (in the main loop) and guess what, then it runs perfectly. Maybe there is a better way to call a Perlscript that takes a parameter than through COM but I haven't found good instructions. Would IActiveScript do the job? Thanks for your help Gregor - Gregor Weihs Ginzton Laboratory, S-23 Stanford University, Stanford, CA 94305 Phone: +1 (650) 723 3929 Fax: +1 (650) 723 5504 - ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RTFF (was Press any key to exit)
> Interesting how people tend to start and end searches these days with > Google. Next time you may want to check the FAQ. The answer > to this question is in PerlFaq8. Following on from this RTFF, I have a problem with perldoc on my W98 machine at home. The lines of text | always come o| ut scre wed up| like this. | Can anyone help? I've tried everything I can think of like varying the font to window size ratios, etc. Thanks. R. ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: REGEX help!
Jamie Murray wrote: > Hi Glenn, > I have worked on this further and looked at some of the previous posts. > I have tried this with all different combinations of ip address and this has > worked. > Of course I got the idea from a previous post from Alex and Mark Thomas. > Please understand I could have just copied and pasted Mark's solution but > then I wouldn't have learned anything. > > if($num =~ /^(([0-1]{0,1}[0-9]{0,1}[0-9]|2[0-4][0-9]|25[0-5])\.?){4}$/) > > I feel that Mark's post is the better choice though and much > slicker than mine. > > my $octet = qr/\d|[01]?\d\d|2[0-4]\d|25[0-5]/; > my $valid_ip = qr/^$octet\.$octet\.$octet\.$octet$/o; > > print "yes" if $ip =~ $valid_ip; This should cover some failing cases : use strict; my $DDD = qr{(:?\d|[01]?\d\d|2[0-4]\d|25[0-5])};# a dotted decimal digit my @ips = ('1.254.255.255', '256.257.258.259', '127.0.0.1', '127.0.1', '127.1', '127'); foreach (@ips) {# made digits 2,3,4 optional if (/^$DDD(:?(:?(:?\.$DDD)?\.$DDD)?\.$DDD)?$/o) { print " OK: $_\n"; } else { print "BAD: $_\n"; } } __END__ This would be faster but uglier : /^(?:\d|[01]?\d\d|2[0-4]\d|25[0-5])(((\.(?:\d|[01]?\d\d|2[0-4]\d|25[0-5]))?\.(?:\d|[01]?\d\d|2[0-4]\d|25[0-5]))?\.(?:\d|[01]?\d\d|2[0-4]\d|25[0-5]))$/ Then there's hex (0x7f01) and decimal IP addresses (2130706433) and IPV6 addresses ([::127.0.0.1]) etc, and inet_aton is still the way to go for pure correctness in checking an IP number. -- ,-/- __ _ _ $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