RE: Win32::OLE::GetActiveObject problem
:-Original Message- :From: [EMAIL PROTECTED] :[mailto:[EMAIL PROTECTED] Behalf Of :Matthew Bertrand :Sent: Friday, 31 December 2004 12:29 PM :To: perl-win32-users@listserv.ActiveState.com :Subject: Re: Win32::OLE::GetActiveObject problem : : :$Bill Luebkert wrote: : :>Share some minimal code snippet. :> :> : :use strict; :use Win32::OLE; : :my $IEWin = Win32::OLE->GetActiveObject("InternetExplorer.Application"); :my $IEDoc = $IEWin->{Document}; :while (defined $IEDoc) { :print "Quitting IE\n"; :$IEWin->Quit(); :sleep(1); :$IEWin = Win32::OLE->GetActiveObject("InternetExplorer.Application"); :$IEDoc = $IEWin->{Document}; :} :print "Done."; : : It's not working on my win2k pro. GetActiveObject doesn' return the existing instance of IE6. Cheers, WWang +-Wenjie Wang a.k.a William -+ | WANG Infonology Systems |EMail : [EMAIL PROTECTED] | | Phone : (02) 9871 2018 |[EMAIL PROTECTED]| | Mobile: 0412 688 380|http://users.bigpond.net.au/WISeAgent | +-+--+ ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Internet Explorer
[snip] :: ::What if I've set the active scripting to "prompt" in my "IE security ::Setting" and I've visiting a site which has VBScript or JavaScript. ::Normally, it'll popup a prompt and ask you "do you want to proceed" ::question. Is it possible to answer the question automatically using the ::script without human intervention? :: [snip] :: :-Original Message- :From: [EMAIL PROTECTED] :[mailto:[EMAIL PROTECTED] Behalf Of :Steven Manross :Sent: Tuesday, 26 October 2004 1:46 AM :To: MJG; [EMAIL PROTECTED] :Subject: RE: Internet Explorer : : :VBScript isn't a problem unless there's a debugging error popping up, or :an ActiveX control that wants to download, that you need to click yes :on. : :And, you would have to mark that ActiveX control as trusted for download :beforehand. : I'd like to automate it fully without the need to click on the "yes" button manually. Is it possible using perl script? Further more, there is an "Internet Security setting" which can set IE to prompt user before executing a script. Nomally, user intervention to click on the "yes" button is required. Could it be automated using perl? Cheers, W Wang --- Wenjie Wang a.k.a William WANG Infonology Systems - your partner for the future EMail : [EMAIL PROTECTED] / [EMAIL PROTECTED] Phone : (02) 9871 2018 Mobile: 0412 688 380 http://users.bigpond.net.au/WISeAgent --- ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Internet Explorer
:-Original Message- :From: [EMAIL PROTECTED] :[mailto:[EMAIL PROTECTED] Behalf Of :$Bill Luebkert :Sent: Sunday, 24 October 2004 11:57 AM :To: MJG :Cc: [EMAIL PROTECTED] :Subject: Re: Internet Explorer : : :MJG wrote: : :> I have what I thought was a rather simple program for setting IE in :> KIOSK mode and opening a web page. Although IE sets up correctly, no :> web page comes up. Any ideas? : :use strict; :use Win32::OLE 'EVENTS'; : :my $IE = Win32::OLE->new('InternetExplorer.Application', 'Quit') or : die "new OLE::MSIE: " . Win32::OLE->LastError(); : :$IE->{Addressbar} = 0; :$IE->{Menubar} = 0; :$IE->{Toolbar} = 0; :$IE->{Width} = 800; :$IE->{Height} = 600; :$IE->{Top} = 0; :$IE->{Left} = 0; :$IE->{Resizable} = 1; :$IE->Navigate('http://www.microsoft.com/');# note change here : :while ($IE->{Busy}) { : Win32::Sleep 500; : Win32::OLE->SpinMessageLoop(); :} : :$IE->{Visible} = 1; : :while ($IE->{Readystate} ne 4) { : Win32::Sleep 500; : Win32::OLE->SpinMessageLoop(); : print "Readystate: $IE->{Readystate}\n"; :} : :sleep 10; : :__END__ : The above codes works fine for the orginal request form MJG. What if I've set the active scripting to "prompt" in my "IE security Setting" and I've visiting a site which has VBScript or JavaScript. Normally, it'll popup a prompt and ask you "do you want to proceed" question. Is it possible to answer the question automatically using the script without human intervention? Cheers, W Wang --- Wenjie Wang a.k.a William WANG Infonology Systems - your partner for the future EMail : [EMAIL PROTECTED] / [EMAIL PROTECTED] Phone : (02) 9871 2018 Mobile: 0412 688 380 http://users.bigpond.net.au/WISeAgent --- ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
mechanize module failed to GET certain sites?
Greetings, I'm using activestate Perl v5.6.1 built for MSWin32-x86-multi-thread on a win2k prof machine. Mechanize module was working fine for me, but recently I failed with following message: 8<--- Can't locate auto/HTML/TokeParser/get_phrase.al in @INC (@INC contains: C:/ASPer l/lib C:/ASPerl/site/lib .) at C:/ASPerl/site/lib/HTML/Form.pm line 130 ->8-- In order to isolate the problem, I'm using the sample code provided with the module, and it still happens;( Following are the dump with debug info turned on: 8<---LWP::Us erAgent::new: () LWP::UserAgent::request: () HTTP::Cookies::add_cookie_header: Checking www.livejournal.com for cookies HTTP::Cookies::add_cookie_header: Checking .livejournal.com for cookies HTTP::Cookies::add_cookie_header: Checking livejournal.com for cookies HTTP::Cookies::add_cookie_header: Checking .com for cookies LWP::UserAgent::send_request: GET http://www.livejournal.com/login.bml LWP::UserAgent::_need_proxy: Not proxied LWP::Protocol::http::request: () LWP::Protocol::collect: read 585 bytes LWP::Protocol::collect: read 3218 bytes LWP::Protocol::collect: read 1414 bytes LWP::Protocol::collect: read 3913 bytes HTTP::Cookies::extract_cookies: Set cookie ljuniq => mCfKjsjmSHOSJ8Z:1097154333 LWP::UserAgent::request: Simple response: OK Can't locate auto/HTML/TokeParser/get_phrase.al in @INC (@INC contains: C:/ASPer l/lib C:/ASPerl/site/lib .) at C:/ASPerl/site/lib/HTML/Form.pm line 130 ->8-- The funny thing is that it happens to certain sites, at least it's been working fine for http://www.smh.com.au/index.htm any idea what module I've been missing? Cheers, W Wang ------- Wenjie Wang a.k.a William WANG Infonology Systems - your partner for the future EMail : [EMAIL PROTECTED] / [EMAIL PROTECTED] Phone : (02) 9871 2018 Mobile: 0412 688 380 http://users.bigpond.net.au/WISeAgent --- ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Perl Script to send mail with Attachment
Try this: $mailer = MIME::Lite->new( From => $from, To => $to, Subject => $subject, Type => 'multipart/mixed' ); $mailer->attach(Type =>'TEXT', Data ="" $emailbody); $mailer->attach(Type =>'TEXT', Path => $anAttachment, Disposition => 'attachment', ); $mailer->send('smtp', $ENV{SMTP_SERVER}, Timeout=>60); --Wenjie Wang(a.k.a. William) [EMAIL PROTECTED]WANG Infonology Systems Ph:(02)-98712018; mob:0412688380http://users.bigpond.net.au/WISeAgent==This e-mail is confidential and may contain legally privileged information. You should not disclose its contents to any other person. If you are not the intended recipient, please notify the sender immediately.Whilst every reasonable precaution has been taken to minimise the risk of computer software viruses, it cannot accept liability for any damage which you may sustain as a result of such viruses. You should carry out your own virus checks before opening the e-mail (and/or any attachments). -Original Message-From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]On Behalf Of Satish KumarSent: Friday, 14 May 2004 9:26 PMTo: [EMAIL PROTECTED]Subject: Perl Script to send mail with Attachment Hi ScriptKings, Im a newbie in Perl, Would like to know following Info: Can we create Perl Scipt to send Mails with Attachments Any Tips, Help, Code,Suggestions & Guidance are Welcome Regards,Satish Do you Yahoo!?SBC Yahoo! - Internet access at a great low price. ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: accepting passwords from console apps
-Original Message- :From: [EMAIL PROTECTED] On Behalf Of Aaron.Tesch I guess you need something like this: my $key; binmode STDIN; print "Key in your password: "; ReadMode ('cbreak'); while (defined (my $ch = ReadKey ())) { last if $ch eq "\x0a" or $ch eq "\x0d"; if ($ch eq "\x08") { # backspace print "\b \b" if $key; chop $key; next; } if ($ch eq "\x15") { # ^U print "\b \b" x length $key; $key = ''; next; } $key .= $ch; print '*'; } ReadMode ('restore'); Regards, WWang -- Wenjie Wang(a.k.a. William)[EMAIL PROTECTED] WANG Infonology Systems Ph:(02)-98712018; mob:0412688380 http://users.bigpond.net.au/WISeAgent == ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: regex questions
:-Original Message- :From: Rob Dixon [mailto:[EMAIL PROTECTED] [snap] : :> :> for issue 1), I can do something like: :> $myDataLine =~ /\s+M\s+\d{1,2}:\d{1,2}\s+(\w+\s\w+\s\w+|\w+\s\w+|\w+)/i; :> $1 is the value I want. :> It'll be nice if there is a more generic expression for it. : :Unless you also want to verify the format of the data there's no need to :match all of :the fields in the data record: Just extract everything after the time field :on the line: : : $myDataLine =~ /\d+:\d+\s+(.*)\s*$/i; : :which should leave the same string in $1. : As a matter of fact, I have to verify the contents of data extracted. in the same data file, it has three data formats: data section header(3 lines), data contents(0, 1, or more lines) which can also have two different format but the same data section header:-(. eg. I need to extract guests pick up hotel and time, departure time and flight number, tour code, tour date and person count. As a means for verification, I also need to get person counter total for the section and compare it with TTL PAX. I've put data fields I need to extract in "[]" in the first line. One data format is: -- 03897429 YZSYDTHA2ND HTL/INT APO ( GJDUMMYTNT *T/NET S/IN OR DG ) TTL PAX:[9] -- M [0:00] [SYD HBR MARROTT] M [10:15] [JL0772] AVA SYD FTM 6 G/UP TYO P [JZ1016T] [4/12/03] 216858[3] M 0:05 HOLIDAYINNDH M 10:15 JL0772 AVA JAL NEW STYLE SYD 6 DLX TY JZ5001N 4/12/03 2172281 M 0:10 MERCURESYDM 10:15 JL0772 AVA YOK M/S 8 TYO JOY JZ1003R 2/12/03 2175452 M 0:10 MERCURESYDM 10:15 JL0772 AVA SYD FTM 5 STD TYO JZ1005H 5/12/03 2169322 M 0:10 MERCURESYDM 10:15 JL0772 AVA SYD FTM 6 STD TYO JZ1006H 4/12/03 2183791 another format is(I've also put data fields I need to extract in "[]" in the first line.): -- 03903300 YZSYDLAH2 SIC INT/SS+L/HTL AVA ( GJDUMMYTNT *T/NET S/IN OR DG ) TTL PAX: [12] -- M [8:30] [JL0771]M [8:00] [FOUR SEASONS] EJR SYD CNS 6 DLX SS TYO [JR5016N] [8/12/03] 217189[2] M 8:30 JL0771M 8:05 FOUR POINTS AVA YAT SYD 5 DLX TYO JZ5005H 8/12/03 2172032 M 8:30 JL0771M 8:05 FOUR POINTS AVA YAT SYD 7 DLX TYO JZ5007I 8/12/03 2172044 M 8:30 JL0771M 8:05 FOUR POINTS AVA YAT SYDCNS 7 DLX TYO JZ5007K 8/12/03 2180232 M 8:30 JL0771M 8:10 MERCURESYD AVA SYD FTM 7 STD TYOP JZ1007H 8/12/03 2171932 :> for issue 2), what I've done is surronding the data field extracted by : color=\"#FF\"> and by using substitute: :> $myDataLine =~ s/(TTL PAX:\s*)$section_pax/$1 color=\"#FF\">$section_pax<\/b><\/font>/i; : :It's hard to guess what you need here without seeing what your data looks :like. I assume there are several fields each with a label like : : TTL PAX: : :in which case you might like to think about matching labels like that in a :loop. The /g modifier will let you carry on searching after the end of the :previous match. (See perldoc perlop and search for m//g). : : while (/[A-Z\x20]+:/g) { :: : } : I might not explaine myself clearly. The data line contains "TTL PAX:" is part of the data section, I only need to extract a numberic field, it's simple. It's not so lucky for the case of other data records except setion header;-( For the sample data listed below, I'd like to enclose all the fields enclosed with "[]" to enclose them with "" and "<\/b><\/font>" I seems not be able to find good way to do it:( M [0:00] [SYD HBR MARROTT] M [10:15] [JL0772] AVA SYD FTM 6 G/UP TYO P [JZ1016T] [4/12/03] 216858 [3] Regards, WWang ---
RE: reg exp help
'[]' means character class, whilest '-' means range. The example you've quoted means all the chars in range from /000 to /177, in another word, the whole ASCII char set. There is a Perl resource CD which contains a few very good Perl reference books. I left it in my office and I can't remember what it is called:-( Another way to find out more on regex is perldoc, or online help, if you're using ActiveState perl. Try : perldoc perlre perldoc perlretut Regards, WWang ------ Wenjie Wang(a.k.a. William)[EMAIL PROTECTED] WANG Infonology Systems Ph:(02)-98712018; mob:0412688380 http://users.bigpond.net.au/WISeAgent == :-Original Message- :From: [EMAIL PROTECTED] :[mailto:[EMAIL PROTECTED] Behalf Of :Eric Edwards :Sent: Monday, 8 December 2003 10:43 AM :To: [EMAIL PROTECTED] :Subject: reg exp help : : :Hello list, :I need help with a regular expression. I am teaching myself perl. :The book I am using has: :the class [\000-\177] matches any seven-bit ASCII character. :What are the two backslashes for. I can't find any explanation for them. :Thanks! :Eric :___ :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: How to execute a command under win98 via perl script?
You got me on it:) Don't trust copy and paste. it was meant to save time, but might ends up spent more time to debug:( Regards, WWang - Wenjie Wang(a.k.a. William) [EMAIL PROTECTED] WANG Infonology Systems Ph: +61 2-98712018/0412688380 = :-Original Message- :From: [EMAIL PROTECTED] :[mailto:[EMAIL PROTECTED] Behalf Of :[EMAIL PROTECTED] :Sent: Wednesday, 27 August 2003 9:32 PM :To: [EMAIL PROTECTED] :Subject: Re: How to execute a command under win98 via perl script? : : : : : : : :Hi, : :don't forget to double '\' inside a "" quoted string. : :Regards, :Martin Kellner : : : : : : : : :Wenjie Wang: 27.08.2003 12:08 : :system "copy c:\a.txt d:\a.txt"; : : : :--------- :Wenjie Wang(a.k.a. William) [EMAIL PROTECTED] :WANG Infonology Systems Ph: +61 2-98712018/0412688380 := : : : -Original Message- : From: [EMAIL PROTECTED] : [mailto:[EMAIL PROTECTED] Behalf Of Tony : Cheung : Sent: Wednesday, 27 August 2003 5:51 PM : To: [EMAIL PROTECTED] : Subject: How to execute a command under win98 via perl script? : : Hi, everybody : How to execute a command under win98 via perl script? Example: copy : c:\a.txt d:\ : Thanks : : : : :** :This email and any files transmitted with it are confidential and :intended solely for the use of the individual or entity to whom they :are addressed. If you have received this email in error please notify :[EMAIL PROTECTED] :This footnote also confirms that this email message has been inspected :by SOPHOS Antivirus for the presence of computer viruses. :** : :___ :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: How to execute a command under win98 via perl script?
system "copy c:\a.txt d:\a.txt"; ---------Wenjie Wang(a.k.a. William) [EMAIL PROTECTED]WANG Infonology Systems Ph: +61 2-98712018/0412688380= -Original Message-From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]On Behalf Of Tony CheungSent: Wednesday, 27 August 2003 5:51 PMTo: [EMAIL PROTECTED]Subject: How to execute a command under win98 via perl script? Hi, everybody How to execute a command under win98 via perl script? Example: copy c:\a.txt d:\ Thanks