It seems that Win32::OLE::Variant doesn't work!
It seems that Win32::OLE::Variant doesn't work! Below is the script: #! perl -W use strict; use Win32::OLE; use Win32::OLE::Variant; my $Array = Variant(VT_ARRAY|VT_R8, [1,2], 2); $Array-Put([[1,2], [3,4]]); Below is the warning message: C:\tst.pl Win32::OLE(0.1702): SetSafeArrayFromAV bad index at C:\tst.pl line 10. Win32::OLE(0.1702) error 0x8002000b: Invalid index at C:\tst.pl line 10 eval {...} called at C:\tst.pl line 10 I am using the following version of perl: This is perl, v5.8.6 built for MSWin32-x86-multi-thread Do you guys have the similar problem? Another quetions is: my $Array = Variant(VT_ARRAY|VT_R8, [1,2], 2); What do 1, 2, 2 mean respectively? Thy mean the lower boundary of the second dimension, the upper boundary of the second dimension, and the total number of dimension? Thank in advance! ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: It seems that Win32::OLE::Variant doesn't work!
perl 5.8.4 on NT4 C:\perl -e use Win32::OLE;use Win32::OLE::Variant; my $Array=Variant(VT_ARRAY| VT_R8,[1,2],2); $Array-Put([1,2],[2,3]); Win32::OLE(0.1701): Win32::OLE::Variant-Put(): Wrong number of indices; dimension of SafeArray is 2 at -e line 1. This works fine... it's normally easier not to create your own arrays, though... if you can retrieve a possibly empty array from the OLE object and modify that or just assign your own array (or anon array) back to it. The OLE module handles the conversion for you and saves tons of hassle. C:\perl -e use Win32::OLE;use Win32::OLE::Variant; my $Array=Variant(VT_ARRAY|VT_R8,[1,2],2); $Array-Put(1,qw/a b/); C:\perl -e use Win32::OLE;use Win32::OLE::Variant ;use Data::Dumper; my $Array=Variant(VT_ARRAY|VT_R8,[1,2],2); print 'Dimensions: ' ; @s= $Array-Dim ; print qq/@s $#s...\n/; print Dumper([EMAIL PROTECTED]); Dimensions: ARRAY(0x15d7c70) ARRAY(0x15d7d84) 1... $VAR1 = [ [ 1, 2 ], [ 0, 1 ] ]; Kind regards, Mark Anderson Service Improvement Programme Level 2, 113 Dundas Street Edinburgh, EH3 5DE Tel: 0131 523 8786 Mob: 07808 826 063 -Original Message- From: [EMAIL PROTECTED] [SMTP:[EMAIL PROTECTED] Sent: Wednesday, June 01, 2005 7:21 AM To: perl-win32-users@listserv.ActiveState.com Subject: It seems that Win32::OLE::Variant doesn't work! *** WARNING : This message originates from the Internet *** It seems that Win32::OLE::Variant doesn't work! Below is the script: ## ## #! perl -W use strict; use Win32::OLE; use Win32::OLE::Variant; my $Array = Variant(VT_ARRAY|VT_R8, [1,2], 2); $Array-Put([[1,2], [3,4]]); Below is the warning message: ## ## C:\tst.pl Win32::OLE(0.1702): SetSafeArrayFromAV bad index at C:\tst.pl line 10. Win32::OLE(0.1702) error 0x8002000b: Invalid index at C:\tst.pl line 10 eval {...} called at C:\tst.pl line 10 I am using the following version of perl: ## ## This is perl, v5.8.6 built for MSWin32-x86-multi-thread Do you guys have the similar problem? Another quetions is: my $Array = Variant(VT_ARRAY|VT_R8, [1,2], 2); ## ## What do 1, 2, 2 mean respectively? Thy mean the lower boundary of the second dimension, the upper boundary of the second dimension, and the total number of dimension? Thank in advance! ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs The Royal Bank of Scotland plc, Registered in Scotland No. 90312. Registered Office: 36 St Andrew Square, Edinburgh EH2 2YB The Royal Bank of Scotland plc is authorised and regulated by the Financial Services Authority and represents The Royal Bank of Scotland Marketing Group. The Bank sells life policies, collective investment schemes and pension products and advises only on the Marketing Group's range of these products and on a With-Profit Bond produced by Norwich Union Life (RBS) Limited. This e-mail message is confidential and for use by the addressee only. If the message is received by anyone other than the addressee, please return the message to the sender by replying to it and then delete the message from your computer. Internet e-mails are not necessarily secure. The Royal Bank of Scotland plc does not accept responsibility for changes made to this message after it was sent. Whilst all reasonable care has been taken to avoid the transmission of viruses, it is the responsibility of the recipient to ensure that the onward transmission, opening or use of this message and any attachments will not adversely affect its systems or data. No responsibility is accepted by The Royal Bank of Scotland plc in this regard and the recipient should carry out such virus and other checks as it considers appropriate. ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
perl Tk question
Hi All! In the following snippet: use strict; use Tk; require Tk::LabFrame; my $top = new MainWindow; my $bar=$top-LabFrame(-label = 'buttons bar'); $bar-pack; my $exi=$bar-Button(-command=\exi,-text='exit'); $exi-pack(-side='left'); my $prg=$bar-Button(-command=\prg,-text='prg'); $prg-pack(-side='left'); my $fr=$top-LabFrame(); $fr-configure(-height='5',-width=30); $fr-pack(-fill='none'); my $text0=$fr-Text(); $text0-configure(-height='10',-width=20); $text0-pack(-side='top',-fill='none'); MainLoop; sub exi{ $top-destroy; } sub prg{ for (my $i=0;$i20;$i++){ $text0-delete('0.0','end'); $text0-insert('end',$i\n); sleep 1; } } When executing this snippet I see in text0 only the last $i /in for cycle/ What I must add to prg code in order to see all cosequtive values of $i ? ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: perl Tk question
Well right now ur deleting all the text before inserting any more. Get rid of the delete line or move it out of the for loop. Then it'll work as expected. At 08:06 AM 6/1/05 UT, [EMAIL PROTECTED] wrote: sub prg{ for (my $i=0;$i20;$i++){ $text0-delete('0.0','end'); $text0-insert('end',$i\n); sleep 1; } } When executing this snippet I see in text0 only the last $i /in for cycle/ What I must add to prg code in order to see all cosequtive values of $i ? -- REMEMBER THE WORLD TRADE CENTER ---= WTC 911 =-- ...ne cede males 0100 ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: perl Tk question
When executing this snippet I see in text0 only the last $i /in for cycle/ What I must add to prg code in order to see all cosequtive values of $i ? for (my $i=0;$i20;$i++){ #$text0-delete('0.0','end'); # just don't delete everytime all contents of the box $text0-insert('end',$i\n); } Regards, Jan Blaha ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: perl Tk question
Just add: $top-update any place inside the prg procedure. On Wed, 1 Jun 2005 08:06:42 UT, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi All! In the following snippet: use strict; use Tk; require Tk::LabFrame; my $top = new MainWindow; my $bar=$top-LabFrame(-label = 'buttons bar'); $bar-pack; my $exi=$bar-Button(-command=\exi,-text='exit'); $exi-pack(-side='left'); my $prg=$bar-Button(-command=\prg,-text='prg'); $prg-pack(-side='left'); my $fr=$top-LabFrame(); $fr-configure(-height='5',-width=30); $fr-pack(-fill='none'); my $text0=$fr-Text(); $text0-configure(-height='10',-width=20); $text0-pack(-side='top',-fill='none'); MainLoop; sub exi{ $top-destroy; } sub prg{ for (my $i=0;$i20;$i++){ $text0-delete('0.0','end'); $text0-insert('end',$i\n); sleep 1; } } When executing this snippet I see in text0 only the last $i /in for cycle/ What I must add to prg code in order to see all cosequtive values of $i ? ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs -- Un saludo, # David TV E-Mail: [EMAIL PROTECTED] # ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: perl Tk question
Looks like it's just because the window doesn't update until you return from the callback. Are you trying to create some sort of special effect? Perhaps asking how to create that effect might be simpler - the Text widget doesn't look like it likes that sort of thing! Kind regards, Mark Anderson Service Improvement Programme Level 2, 113 Dundas Street Edinburgh, EH3 5DE Tel: 0131 523 8786 Mob: 07808 826 063 -Original Message- From: [EMAIL PROTECTED] [SMTP:[EMAIL PROTECTED] Sent: Wednesday, June 01, 2005 9:07 AM To: perl-win32-users@listserv.ActiveState.com Subject: perl Tk question *** WARNING : This message originates from the Internet *** Hi All! In the following snippet: use strict; use Tk; require Tk::LabFrame; my $top = new MainWindow; my $bar=$top-LabFrame(-label = 'buttons bar'); $bar-pack; my $exi=$bar-Button(-command=\exi,-text='exit'); $exi-pack(-side='left'); my $prg=$bar-Button(-command=\prg,-text='prg'); $prg-pack(-side='left'); my $fr=$top-LabFrame(); $fr-configure(-height='5',-width=30); $fr-pack(-fill='none'); my $text0=$fr-Text(); $text0-configure(-height='10',-width=20); $text0-pack(-side='top',-fill='none'); MainLoop; sub exi{ $top-destroy; } sub prg{ for (my $i=0;$i20;$i++){ $text0-delete('0.0','end'); $text0-insert('end',$i\n); sleep 1; } } When executing this snippet I see in text0 only the last $i /in for cycle/ What I must add to prg code in order to see all cosequtive values of $i ? ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs The Royal Bank of Scotland plc, Registered in Scotland No. 90312. Registered Office: 36 St Andrew Square, Edinburgh EH2 2YB The Royal Bank of Scotland plc is authorised and regulated by the Financial Services Authority and represents The Royal Bank of Scotland Marketing Group. The Bank sells life policies, collective investment schemes and pension products and advises only on the Marketing Group's range of these products and on a With-Profit Bond produced by Norwich Union Life (RBS) Limited. This e-mail message is confidential and for use by the addressee only. If the message is received by anyone other than the addressee, please return the message to the sender by replying to it and then delete the message from your computer. Internet e-mails are not necessarily secure. The Royal Bank of Scotland plc does not accept responsibility for changes made to this message after it was sent. Whilst all reasonable care has been taken to avoid the transmission of viruses, it is the responsibility of the recipient to ensure that the onward transmission, opening or use of this message and any attachments will not adversely affect its systems or data. No responsibility is accepted by The Royal Bank of Scotland plc in this regard and the recipient should carry out such virus and other checks as it considers appropriate. ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Net::Telnet
Hi, I am using this module (Net::Telnet) downloaded from CPAN, for a small interactive program in which I telnet to a particular host, login and give some commands (based on the options you get). I am not able to do this. I am able to login but whatever I do after that doesn't seem to happen. Can someone suggest what might be going wrong!!! After login, the control console shows --- Control Console --- 1- Device Manager 2- Network 3- System 4- Logout ESC- Main Menu, ENTER- Refresh, CTRL-L- Event Log Please let me know your inputs. Test.txt Thanks Regards, Rajesh. ** The information contained in this email and any attachments is likely to be confidential and legally privileged, and is for the intended recipient named above only. Any copying, dissemination, disclosure of or use of this email or its attachments unless authorised by us is prohibited, except that you may forward this email and/or attachments to a third party on a strict need to know basis. If you have received this email in error, please notify us immediately by replying to the email or by calling +91-80-22297030. Please then delete this email and any full or partial copies of it. You as the intended recipient must be aware and accept that emailis not a totally secure communications medium. Although we have taken all reasonable steps to make sure this email and any attachments are free from viruses, we do not (to the extent permitted by law) accept any liability whatsoever for any virus infection and/or compromise of security caused by this email and any attachment. No contract may be formed or documents served by you on or with us by this email or any attachments unless expressly agreed otherwise by us. Any views expressed in this email or attachments by an individual are not necessarily those of UbiNetics India (Private) Limited. ** print I am starting my script\n; use Net::Telnet; my $t = new Net::Telnet (Timeout = 10, Prompt = '/bash\$ $/'); my $username = apc; my $passwd = apc; $t-open(192.168.0.15); print I got connected\n; $t-waitfor('/User Name :.*$/'); $t-print($username\n); $t-waitfor('/Password :.*$/'); $t-print($passwd\n); print I have logged in\n; sleep(2); $t-print(1); print This is first step\n; sleep(2); $t-print(3); print This is second step\n; sleep(2); $t-print(1); print This is third step\n; sleep(2); $t-print(1); print This is fourth step\n; sleep(2); $t-print(3); print This is fifth step\n; sleep(2); $t-print(YES); print This is sixth step\n; sleep(2); $t-print(); print This is seventh step\n;___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: perl Tk question
[EMAIL PROTECTED] wrote: Hi All! In the following snippet: use strict; use Tk; require Tk::LabFrame; my $top = new MainWindow; my $bar=$top-LabFrame(-label = 'buttons bar'); $bar-pack; my $exi=$bar-Button(-command=\exi,-text='exit'); $exi-pack(-side='left'); my $prg=$bar-Button(-command=\prg,-text='prg'); $prg-pack(-side='left'); my $fr=$top-LabFrame(); $fr-configure(-height='5',-width=30); $fr-pack(-fill='none'); my $text0=$fr-Text(); $text0-configure(-height='10',-width=20); $text0-pack(-side='top',-fill='none'); MainLoop; sub exi{ $top-destroy; } sub prg{ for (my $i=0;$i20;$i++){ $text0-delete('0.0','end'); $text0-insert('end',$i\n); sleep 1; } } When executing this snippet I see in text0 only the last $i /in for cycle/ What I must add to prg code in order to see all cosequtive values of $i ? I believe it's becuase you're not getting back to MainLoop to update the display. You could put the prg sub on a timer and handle it that way or force a screen update with '$text0-update;' in the prg loop. -- ,-/- __ _ _ $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 Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: perl Tk question
Here you go I took out your sleep and added a timer. Sleep will block tk handling events. The built in timer will not be blocked. So you will be able to do things like refresh the gui and move the window around the screen, etc. The '$top-update' is probably not required I just added it to force an update. Good thing about the timer, it handles starting and stopping a reaction to an event for you. Just remember to trip the alarm. Otherwise when your problem should end it will appear to hang. The bad thing is, I think that there is only one timer. I could be wrong but I do not think there is more than one. -Darian use strict; use Tk; require Tk::LabFrame; my $top = new MainWindow; my $bar=$top-LabFrame(-label = 'buttons bar'); $bar-pack; my $exi=$bar-Button(-command=\exi,-text='exit'); $exi-pack(-side='left'); my $prg=$bar-Button(-command=\prg,-text='prg'); $prg-pack(-side='left'); my $fr=$top-LabFrame(); $fr-configure(-height='5',-width=30); $fr-pack(-fill='none'); my $text0=$fr-Text(); $text0-configure(-height='10',-width=20); $text0-pack(-side='top',-fill='none'); my $alarm = 0;# added my $counter = 0; # added my $counting = 0; # added my $id; # added MainLoop; sub exi{ if($counting) { $alarm++; } # added $top-destroy; } sub prg{ $counter = 0; # added $counting = 1; # added $id = $top-repeat(500, \Timer); # added $top-waitVariable($alarm); # added $top-afterCancel($id); # added #for (my $i=0;$i20;$i++){ # $text0-delete('0.0','end'); # $text0-insert('end',$i\n); # sleep 1; #} } # added new function sub Timer { $text0-delete('0.0', 'end'); $text0-insert('end',sprintf(%02d, $counter++)); $top-update; if($counter 20) { $alarm++; $counting=0; }; } -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of [EMAIL PROTECTED] Sent: Wednesday, June 01, 2005 3:07 AM To: perl-win32-users@listserv.ActiveState.com Subject: perl Tk question Hi All! In the following snippet: use strict; use Tk; require Tk::LabFrame; my $top = new MainWindow; my $bar=$top-LabFrame(-label = 'buttons bar'); $bar-pack; my $exi=$bar-Button(-command=\exi,-text='exit'); $exi-pack(-side='left'); my $prg=$bar-Button(-command=\prg,-text='prg'); $prg-pack(-side='left'); my $fr=$top-LabFrame(); $fr-configure(-height='5',-width=30); $fr-pack(-fill='none'); my $text0=$fr-Text(); $text0-configure(-height='10',-width=20); $text0-pack(-side='top',-fill='none'); MainLoop; sub exi{ $top-destroy; } sub prg{ for (my $i=0;$i20;$i++){ $text0-delete('0.0','end'); $text0-insert('end',$i\n); sleep 1; } } When executing this snippet I see in text0 only the last $i /in for cycle/ What I must add to prg code in order to see all cosequtive values of $i ? ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: perl Tk question
Hi, You are deleting whatever is in $text0 till the énd'. Comment that out and you will see all the values of $i. ... sub prg{ for (my $i=0;$i20;$i++){ # $text0-delete('0.0','end');# commented out $text0-insert('end',$i\n); # sleep 1; } } Bye, Zeray |-+- | | | | | | | | | | | | | | | | |[EMAIL PROTECTED] | | | | | |Sent by: | | |[EMAIL PROTECTED]| | |.com | | | | | |2005-06-01 10:06 AM | | |Please respond to synoptic | |-+- --| | | | To: perl-win32-users@listserv.ActiveState.com | | cc: (bcc: Zeray Abraha/WLR/SC/PHILIPS) | | Subject:perl Tk question | | | | Classification: | | | | | --| Hi All! In the following snippet: use strict; use Tk; require Tk::LabFrame; my $top = new MainWindow; my $bar=$top-LabFrame(-label = 'buttons bar'); $bar-pack; my $exi=$bar-Button(-command=\exi,-text='exit'); $exi-pack(-side='left'); my $prg=$bar-Button(-command=\prg,-text='prg'); $prg-pack(-side='left'); my $fr=$top-LabFrame(); $fr-configure(-height='5',-width=30); $fr-pack(-fill='none'); my $text0=$fr-Text(); $text0-configure(-height='10',-width=20); $text0-pack(-side='top',-fill='none'); MainLoop; sub exi{ $top-destroy; } sub prg{ for (my $i=0;$i20;$i++){ $text0-delete('0.0','end'); $text0-insert('end',$i\n); sleep 1; } } When executing this snippet I see in text0 only the last $i /in for cycle/ What I must add to prg code in order to see all cosequtive values of $i ? ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
parsing event logs in win2000
hi all, i need to parse system event logs for win2000 Professional and i can see what i'm looking for when i use the viewer; i can also save the log in text format from the viewer. Is there any way i could programmatically get an *.evt file in a given path AND SAVE IT IN TEXT FORMAT, and then open and parse? Thanks, David __ Discover Yahoo! Stay in touch with email, IM, photo sharing and more. Check it out! http://discover.yahoo.com/stayintouch.html ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Net::Telnet
Hi, I am using this module (Net::Telnet) downloaded from CPAN, for a small interactive program in which I telnet to a particular host, login and give some commands (based on the options you get). I am not able to do this. I am able to login but whatever I do after that doesn't seem to happen. Can someone suggest what might be going wrong!!! After login, the control console shows --- Control Console --- 1- Device Manager 2- Network 3- System 4- Logout ESC- Main Menu, ENTER- Refresh, CTRL-L- Event Log You have to reset the Prompt. It is expecting and waiting for a '/bash\$ $/' prompt. You may also change the Prompt under the cmd method, in case it changes throughout the session. ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Reg Exp - Extracting html files
I'm searching many big text columns in my database and I need to extract just the html file names. So far I'm working with directories and file names. So it needs to grab the file names from examples like. directory/file2.html dir/dir2/testfile.htm and list file2.html testfile.htm etc.. any help greatly appreciated. Thanks in advance Steve ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Net::Telnet
When Net::Telnet doesn't do what you expect, 99% of the time it's a prompt issue. Did you set the prompt? The default prompt works with the unix command line, but you'll have to set it to work with your application. I highly recommend using the debugging options; they can help you figure out problems like these. -- Mark Thomas Internet Systems Architect ___ BAE SYSTEMS Information Technology 2525 Network Place Herndon, VA 20171 USA -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Rajesh Vattem Sent: Wednesday, June 01, 2005 9:37 AM To: perl-win32-users@listserv.ActiveState.com Subject: Net::Telnet Hi, I am using this module (Net::Telnet) downloaded from CPAN, for a small interactive program in which I telnet to a particular host, login and give some commands (based on the options you get). I am not able to do this. I am able to login but whatever I do after that doesn't seem to happen. Can someone suggest what might be going wrong!!! After login, the control console shows --- Control Console --- 1- Device Manager 2- Network 3- System 4- Logout ESC- Main Menu, ENTER- Refresh, CTRL-L- Event Log Please let me know your inputs. Test.txt Thanks Regards, Rajesh. ** The information contained in this email and any attachments is likely to be confidential and legally privileged, and is for the intended recipient named above only. Any copying, dissemination, disclosure of or use of this email or its attachments unless authorised by us is prohibited, except that you may forward this email and/or attachments to a third party on a strict need to know basis. If you have received this email in error, please notify us immediately by replying to the email or by calling +91-80-22297030. Please then delete this email and any full or partial copies of it. You as the intended recipient must be aware and accept that emailis not a totally secure communications medium. Although we have taken all reasonable steps to make sure this email and any attachments are free from viruses, we do not (to the extent permitted by law) accept any liability whatsoever for any virus infection and/or compromise of security caused by this email and any attachment. No contract may be formed or documents served by you on or with us by this email or any attachments unless expressly agreed otherwise by us. Any views expressed in this email or attachments by an individual are not necessarily those of UbiNetics India (Private) Limited. ** ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: parsing event logs in win2000
Dan Jablonsky wrote: hi all, i need to parse system event logs for win2000 Professional and i can see what i'm looking for when i use the viewer; i can also save the log in text format from the viewer. Is there any way i could programmatically get an *.evt file in a given path AND SAVE IT IN TEXT FORMAT, and then open and parse? Have you tried Win32_EventLog module ? -- ,-/- __ _ _ $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 Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: Reg Exp - Extracting html files
I'm working with ASCII text files that can be so big they'll make you wince. We're talking 40 MB and up. I'm scanning all files, seeing if they contain info we want, and then extracting any desired info from each. Or trying to, anyway. Yesterday I got a nasty Memory Allocation Error in my feedback. My error message said the Perl Commmand Line Interpreter has encountered an error and must close. I'm still in the middle of figuring that one out. Today I worked on another pile of files and they went through smoothly. If you have a specific problem you can boil down and spell out specifically, I may be able to relate it to a problem I solved in my own script. -- Craig steve silvers wrote: I'm searching many big text columns in my database and I need to extract just the html file names. So far I'm working with directories and file names. So it needs to grab the file names from examples like. directory/file2.html dir/dir2/testfile.htm and list file2.html testfile.htm etc.. any help greatly appreciated. Thanks in advance Steve --- avast! Antivirus: Outbound message clean. Virus Database (VPS): 0522-6, 06/01/2005 Tested on: 6/1/2005 3:04:24 PM avast! - copyright (c) 1988-2004 ALWIL Software. http://www.avast.com ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: Reg Exp - Extracting html files
steve silvers wrote: I'm searching many big text columns in my database and I need to extract just the html file names. So far I'm working with directories and file names. So it needs to grab the file names from examples like. directory/file2.html dir/dir2/testfile.htm and list file2.html testfile.htm You can use File::Basename or I usually just opt for a RE: (my $filename = $path) =~ s/^.*[\\\/]//;# get just the filename portion of path -- ,-/- __ _ _ $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 Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: :Telnet
What kind of particular host are telnetting into? The Net::Telnet module works connecting to the following telnet servers: WindowsNT 4.0, Cisco Routers, Most of the Unix varients. its does not work on these servers: Windows 2000 Pro, Windows XP pro, Windows 2000 server pro, Windows server 2003. Reason is, the new windows server uses ANSI codes and you CAN'T turn them off like on a UNIX box. These ANSI codes garble up the responses to Net::Telnet. Cheers, John -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Rajesh Vattem Sent: Wednesday, June 01, 2005 9:37 PM To: perl-win32-users@listserv.ActiveState.com Subject: Net::Telnet Hi, I am using this module (Net::Telnet) downloaded from CPAN, for a small interactive program in which I telnet to a particular host, login and give some commands (based on the options you get). I am not able to do this. I am able to login but whatever I do after that doesn't seem to happen. Can someone suggest what might be going wrong!!! After login, the control console shows --- Control Console --- 1- Device Manager 2- Network 3- System 4- Logout ESC- Main Menu, ENTER- Refresh, CTRL-L- Event Log Please let me know your inputs. Test.txt Thanks Regards, Rajesh. ** The information contained in this email and any attachments is likely to be confidential and legally privileged, and is for the intended recipient named above only. Any copying, dissemination, disclosure of or use of this email or its attachments unless authorised by us is prohibited, except that you may forward this email and/or attachments to a third party on a strict need to know basis. If you have received this email in error, please notify us immediately by replying to the email or by calling +91-80-22297030. Please then delete this email and any full or partial copies of it. You as the intended recipient must be aware and accept that emailis not a totally secure communications medium. Although we have taken all reasonable steps to make sure this email and any attachments are free from viruses, we do not (to the extent permitted by law) accept any liability whatsoever for any virus infection and/or compromise of security caused by this email and any attachment. No contract may be formed or documents served by you on or with us by this email or any attachments unless expressly agreed otherwise by us. Any views expressed in this email or attachments by an individual are not necessarily those of UbiNetics India (Private) Limited. ** ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: It seems that Win32::OLE::Variant doesn't work!
Thanks for you guys help. $Bill Luebkert [EMAIL PROTECTED] found that is a typo of the document: ActivePerl User Guide. Win32::OLE::NEWS - What's new in Win32::OLE The VARIANT-Put(ARRAYREF) form allows assignment to a complete SAFEARRAY This allows automatic conversion from a list of lists to a SAFEARRAY. You can now write: my $Array = Variant(VT_ARRAY|VT_R8, [1,2], 2); # It should be: # my $Array = Variant(VT_ARRAY|VT_R8, [0,1], 2); $Array-Put([[1,2], [3,4]]); instead of the tedious: $Array-Put(1,0,1); $Array-Put(1,1,2); $Array-Put(2,0,3); $Array-Put(2,1,4); On 6/1/05, Anderson, Mark (Service Delivery) [EMAIL PROTECTED] wrote: perl 5.8.4 on NT4 C:\perl -e use Win32::OLE;use Win32::OLE::Variant; my $Array=Variant(VT_ARRAY| VT_R8,[1,2],2); $Array-Put([1,2],[2,3]); Win32::OLE(0.1701): Win32::OLE::Variant-Put(): Wrong number of indices; dimension of SafeArray is 2 at -e line 1. This works fine... it's normally easier not to create your own arrays, though... if you can retrieve a possibly empty array from the OLE object and modify that or just assign your own array (or anon array) back to it. The OLE module handles the conversion for you and saves tons of hassle. C:\perl -e use Win32::OLE;use Win32::OLE::Variant; my $Array=Variant(VT_ARRAY|VT_R8,[1,2],2); $Array-Put(1,qw/a b/); C:\perl -e use Win32::OLE;use Win32::OLE::Variant ;use Data::Dumper; my $Array=Variant(VT_ARRAY|VT_R8,[1,2],2); print 'Dimensions: ' ; @s= $Array-Dim ; print qq/@s $#s...\n/; print Dumper([EMAIL PROTECTED]); Dimensions: ARRAY(0x15d7c70) ARRAY(0x15d7d84) 1... $VAR1 = [ [ 1, 2 ], [ 0, 1 ] ]; Kind regards, Mark Anderson Service Improvement Programme Level 2, 113 Dundas Street Edinburgh, EH3 5DE Tel: 0131 523 8786 Mob: 07808 826 063 -Original Message- From: [EMAIL PROTECTED] [SMTP:[EMAIL PROTECTED] Sent: Wednesday, June 01, 2005 7:21 AM To: perl-win32-users@listserv.ActiveState.com Subject: It seems that Win32::OLE::Variant doesn't work! *** WARNING : This message originates from the Internet *** It seems that Win32::OLE::Variant doesn't work! Below is the script: ## ## #! perl -W use strict; use Win32::OLE; use Win32::OLE::Variant; my $Array = Variant(VT_ARRAY|VT_R8, [1,2], 2); $Array-Put([[1,2], [3,4]]); Below is the warning message: ## ## C:\tst.pl Win32::OLE(0.1702): SetSafeArrayFromAV bad index at C:\tst.pl line 10. Win32::OLE(0.1702) error 0x8002000b: Invalid index at C:\tst.pl line 10 eval {...} called at C:\tst.pl line 10 I am using the following version of perl: ## ## This is perl, v5.8.6 built for MSWin32-x86-multi-thread Do you guys have the similar problem? Another quetions is: my $Array = Variant(VT_ARRAY|VT_R8, [1,2], 2); ## ## What do 1, 2, 2 mean respectively? Thy mean the lower boundary of the second dimension, the upper boundary of the second dimension, and the total number of dimension? Thank in advance! ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs The Royal Bank of Scotland plc, Registered in Scotland No. 90312. Registered Office: 36 St Andrew Square, Edinburgh EH2 2YB The Royal Bank of Scotland plc is authorised and regulated by the Financial Services Authority and represents The Royal Bank of Scotland Marketing Group. The Bank sells life policies, collective investment schemes and pension products and advises only on the Marketing Group's range of these products and on a With-Profit Bond produced by Norwich Union Life (RBS) Limited. This e-mail message is confidential and for use by the addressee only. If the message is received by anyone other than the addressee, please return the message to the sender by replying to it and then delete the message from your computer. Internet e-mails are not necessarily secure. The Royal Bank of Scotland plc does not accept responsibility for changes made to this message after it was sent. Whilst all reasonable care has been taken to avoid the transmission of viruses, it is the responsibility of the recipient to ensure that the onward transmission, opening or use of this message and any attachments will not adversely affect its systems or data. No responsibility is accepted by The Royal Bank of Scotland plc in this regard and the recipient
Argument passing between perl and C function.
Argument passing between perl and a C function. There is C function in a OLE server: What kind of variable should I pass to this function? # BOOL Calculate(BSTR* names, double* values, short number_of_names); I tried the following script, but there is always an error like Type mismatch ... Is there any simple way to pass argument between perl and C function? # #! perl -W use strict; use Win32::OLE; use Win32::OLE::Variant; my $names = Variant(VT_BSTR|VT_ARRAY, 3); my $values = Variant(VT_R8|VT_ARRAY, 3); $names-Put(['name1', 'name2', 'name3']); $values-Put([0, 0, 0]); my $ret = $app-Calculate($names, $values, 3); ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re:Re: perl Tk question
[EMAIL PROTECTED] wrote: Hi All! In the following snippet: use strict; use Tk; require Tk::LabFrame; my $top = new MainWindow; my $bar=$top-LabFrame(-label = 'buttons bar'); $bar-pack; my $exi=$bar-Button(-command=\exi,-text='exit'); $exi-pack(-side='left'); my $prg=$bar-Button(-command=\prg,-text='prg'); $prg-pack(-side='left'); my $fr=$top-LabFrame(); $fr-configure(-height='5',-width=30); $fr-pack(-fill='none'); my $text0=$fr-Text(); $text0-configure(-height='10',-width=20); $text0-pack(-side='top',-fill='none'); MainLoop; sub exi{ $top-destroy; } sub prg{ for (my $i=0;$i20;$i++){ $text0-delete('0.0','end'); $text0-insert('end',$i\n); sleep 1; } } When executing this snippet I see in text0 only the last $i /in for cycle/ What I must add to prg code in order to see all consequtive values of $i ? I believe it's becuase you're not getting back to MainLoop to update the display. You could put the prg sub on a timer and handle it that way or force a screen update with '$text0-update;' in the prg loop. Thanks to all ! I received even more than I asked for ! It is a Great List! update is the answer. === I looked for no special effects - I only wanted to implement status line in my perl-Tk to register starting -stopping of applications ...etc ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs