Re: PERL on a CD

2006-07-25 Thread D D Allen
The other option is to "compile" / package the Perl script into a stand alone executable -- which could then be readily run from a CD -- without having to address getting all of the Perl environment and path variables right. There are two solutions for "compiling" / packaging Perl scripts:  (1) A

Re: Wide character Filename in Perl 5.8

2006-06-21 Thread D D Allen
The "wide_system_calls" option was intentionally disabled in Perl 5.8.  See the following posting from Jan Dubois. http://aspn.activestate.com/ASPN/Mail/Message/perl5-porters/2933666 There are two work arounds to this problem.   (1)  Use the "FileSystem.Scripting"  OLE object as referenced in

System (1, 'start command'). [was Re: How spawn independent commandline utilities in their own Command Processors?]

2006-06-07 Thread D D Allen
I noticed that your solution uses the construct "system( 1, 'start command' )".   A month or so ago, I saw this construct used in a posting to this list and added it to a Perl/Tk script to launch a web page in the default browser.  Control is immediately returned to the calling perl/Tk script and

RE: Question about Win32-OLE

2006-05-25 Thread D D Allen
While this shouldn't make a difference, as I found out recently with a Win32::OLE script that I was working on, it can make a difference (pointed out by Jan Dubois). Change the extension of your test script to ".pls" and then run it using WSH / cscript:  "C:\my perl scripts>cscript test.pls" Re

Re: OLE - GETTING EXCEL CELL NAMES [Explanation]

2006-05-15 Thread D D Allen
First, I would suggest that you get the book "Excel 2003 VBA Programmer's Reference" by Wiley Publishing.  1100+ pages that still doesn't cover everything..  And yes, you must mentally translate VBA to Perl "on the fly" as you read it.  But you'll also find that it's useful when you have to create

Re: "WbemScripting.SWbemRefresher" VBScript -> Perl

2006-05-12 Thread D D Allen
If you're confused twice, I'm confused three times. I updated the default impersonation setting in "Component Services -> Computers -> My Computer" as you suggested.  Never having looked at this before, I thought that it shouldn't work because the default setting should be overriden by the

Re: "WbemScripting.SWbemRefresher" VBScript -> Perl

2006-05-12 Thread D D Allen
Thank you for your response.   I get the same access denied error whether I use the double blackslashes ("\\") or the single forward slashes ("/") -- running under Windows XP Professional SP1 (with all applied security patches).   But when I run this under WSH (windows scripting hosting)  as

RE: "WbemScripting.SWbemRefresher" VBScript -> Perl

2006-05-12 Thread D D Allen
rl=""> But "[EMAIL PROTECTED]" was able to run this as a native perl script... so he may hold the answer to the riddle. Regards, ... Dewey "Jan Dubois" <[EMAIL PROTECTED]> 05/11/2006 11:28 PM To D D Allen/Fairfax/[EMAIL PROTECTED], "'Timothy

RE: "WbemScripting.SWbemRefresher" VBScript -> Perl

2006-05-11 Thread D D Allen
SWbemService object.  And on MSDN, SWbemServices and SWbemServicesEx are different -- with SWbemServicesEx being derived from the SWbemServices class.  Maybe this makes a difference in Perl but not in _vbscript_... Regards, ... Dewey "Timothy Johnson" <[EMAIL PROTECTED]>

"WbemScripting.SWbemRefresher" VBScript -> Perl

2006-05-11 Thread D D Allen
I've been trying to write a Perl script that uses the WMI OLE object "WbemScripting.SWbemRefresher" to access TCP statistics -- using the WMI performance counter class "Win32_PerfFormattedData_Tcpip_NetworkInterface". I've got it working in _vbscript_ "no issues".  But my Perl Win32::OLE translat

RE: Guidance on how to get TCP bytes / packets sent & received [WbemScripting.SWbemRefresher]

2006-05-08 Thread D D Allen
Thanks for the reference.  I'm trying to make it work using "WbemScripting.SWbemRefresher" which I believe is required to see changing values ... but I get an "Access Denied" error with the AddEnum method.  The AddEnum method does show up in Jan Dubios' Win32::OLE Type Library Browser.  ["Micr

Re: Sort not fixing order in equivalent subsequences

2006-05-05 Thread D D Allen
y $ns (sort {$a->{'status'} <=> $b->{'status'}} @nsarray) {                 print "name => '", $ns->{'name'}, "', status = '", $ns->{'status'}, "'\n";         }         eval '

Re: Performance of Data::Dump

2006-05-05 Thread D D Allen
Suggest you investigate the following modules: Storable        http://search.cpan.org/~ams/Storable-2.15/Storable.pm DBM::Deep        http://search.cpan.org/~rkinyon/DBM-Deep/lib/DBM/Deep.pm I'm using DBM::Deep in a project to store thousands of hashes elements (that include hash elements) and

Re: Sort not fixing order in equivalent subsequences

2006-05-05 Thread D D Allen
The documentation you're looking for is available at this URL. http://search.cpan.org/~nwclark/perl-5.8.8/lib/sort.pm Read the Description section -- particularly the parts about "stablility". There are two solutions. A:  use sort 'stable'; B:  sort on both status and name as follows. sort

Guidance on how to get TCP bytes / packets sent & received

2006-05-05 Thread D D Allen
Anyone have any guidance on how to determine the numbers of network (TCP) bytes and/or packets sent / received over a TCP interface from a Perl script (AS 5.8.8 build 817)?  Is there some method to get this information from WMI (?) or some other internal / system level Windows XP interface? I've

So is 'alarm' implemented under Win32?

2006-04-25 Thread D D Allen
I feel like I'm asking a dumb question but is 'alarm' implemented under Win32 in ActiveState Perl 5.8.8 build 817? When I try to use the alarm function from Time::HiRes, I receive the following... Time::HiRes::alarm(): unimplemented in this platform at pmpmark.pl line 112.         ...propaga

Re: Help with DBD::DB2

2006-04-20 Thread D D Allen
led DBI, >you can also do so via: > > >ppm install http://www.cpan.org/authors/id/H/HO/HOYMICH/db2/perl58/DBI-1.45.ppd > > >As you are already aware, you must install DBI before installing >DBD-DB2. Regards, ... Dewey external:     +1-703-716-9060 IBM T/L:    470-9546

Re: Iffor

2006-04-18 Thread D D Allen
[Soap box warning...] You seem to be suffering from a common perl programming psychosis: the sometimes unbearable urge to write clever perl in the fewest possible number of lines ... that infects us all from time to time... Read Damian Conway's Perl Best Practices.  And when you feel the need to

RE: Quick Q [-d test with unicode/wide directory names]

2006-04-18 Thread D D Allen
write a Perl module / CPAN distribution to do this Regards, ... Dewey "Timothy Johnson" <[EMAIL PROTECTED]> 04/17/2006 08:38 PM To D D Allen/Fairfax/[EMAIL PROTECTED], "Ng, Bill" <[EMAIL PROTECTED]>, "Trevor Joerges" <[EMAIL PROTECTED]

Fw: Non-blocking IO?

2006-04-18 Thread D D Allen
I'd look at POE which contains functionality to do lots of things "non-blocking" including Web server functionality -- see poe.perl.org.   Look at the cookbook examples under "Web" at http://poe.perl.org/?POE_Cookbook And there's a POE mailing list at [EMAIL PROTECTED] For Win32 PPMs, you'll nee

Re: Quick Q [-d test with unicode/wide directory names]

2006-04-17 Thread D D Allen
A quick word of caution about the -d directory operator under Win32 (and -e and opendir and ...).   If the Win32 directory name contains unicode / wide characters, the -d operator will always return "false".  As I understand it, Win32 Perl uses the A (ansi) version of the Win32 API directory calls

RE: What is the best way to write a sort comparison function thataccesses non-global data?

2006-04-11 Thread D D Allen
So... going a bit overboard  I coded three variations of the print_names subroutine.   Version 1 is my version with the sort comparison inline (no external sort subroutine).   Version 2 is your version with the sort comparison in a sort subroutine that includes two internally scoped variable

Re: What is the best way to write a sort comparison function that acc esses non-global data?

2006-04-10 Thread D D Allen
In essence, get rid of the sort sub because in Perl, embedding subroutines within subroutines is an iffy practice at best. In the following, "print_names" has been modified to include the sort parameters inline with the sort statement. "print_names2" changes $person to %person, a hash reference

Re: Re[2]: accurate timing in windows [multimedia timers]

2006-03-29 Thread D D Allen
02 PM Please respond to Lists <[EMAIL PROTECTED]> To D D Allen/Fairfax/[EMAIL PROTECTED] cc perl-win32-users@listserv.ActiveState.com Subject Re[2]: accurate timing in windows [multimedia timers] Greetings D, Actually, the 1 ms. resolution is not the problem. It is the varia

Re: Modifying the Address property of an Excel Hyperlink object with Win32::OLE

2006-03-29 Thread D D Allen
The 1,100+ page book "Excel 2003 VBA" has only minimal information on Hyperlinks.  As Hyperlinks are a "collection", I believe you need to "use Win32::OLE::Enum" to be able to iterate through all of the Hyperlink objects on a given worksheet.  Once you find the "right" Hyperlink object (based on t

Re: accurate timing in windows [multimedia timers]

2006-03-29 Thread D D Allen
Your statements and sample code indicate that you need to execute code based on "real time" / timer events that need to be accurate to 1ms.  Executing a loop that uses the sleep function call is an imperfect way to mimic timer events.  There is no guarantee that a request to sleep for 1ms will alw

Re: Missing IO::Scalar build 816

2006-03-15 Thread D D Allen
This is probably best directed to ActiveState's PPM mailing list -- which is generally very low traffic. IO::Scalar seems to be one of those odd perl modules where the package name is different than the "use" module name.  In this case, if you look at the CPAN entry for IO::Scalar, you'll see the

Win32 fork emulation (was: tk .. fork ... crump)

2006-03-10 Thread D D Allen
To demonstrate the issue with Win32 fork emulation   I adapted the following from Lincoln Stein's book "Network Programming with Perl" (page 45, figure 2.3, "Using pipe() to create linked filehandles").  Ok... so fork works under Win32 systems but it does not appear to behave in the same manne

Re: tk .. fork ... crump

2006-03-10 Thread D D Allen
This should be directed to the Perl Tk newsgroup "comp.lang.perl.tk".  Understand that use of fork under Tk has been a problem for a long time.  And under Windows, the "fork" call is emulated using threads -- as there is no Win32 api "fork" call.   In the Perl Tk newsgroup, on 16 November 2005, t

Fw: How to best replace one string with another in a text file

2006-03-04 Thread D D Allen
Ok... so . I'm a bit nuts. I added a fifth and sixth variation in the series "how best to replace one string with another in a text file" -- which seems to be a great example of the many ways to code even simple problems in Perl. For this round of testing, I quadrupled the size of the test t

Re: Fw: How to best replace one string with another in a text file

2006-03-01 Thread D D Allen
exity.  With the while loop, line at a time variation, file size is irrelevant -- other than as related to runtime. Regards, ... Dewey Lyle Kopnicky <[EMAIL PROTECTED]> 03/01/2006 01:46 PM To D D Allen/Fairfax/[EMAIL PROTECTED] cc Paul Rousseau <[EMAIL PROTECTED]>, Per

Fw: How to best replace one string with another in a text file

2006-03-01 Thread D D Allen
For yucks, I tested three variations (in separate scripts) of replacing one string with another in a text file -- that contained ~16,100 lines -- replacing 190 occurrences of the target string.  The three variations are shown below.  Time::HiRes ( gettimeofday tv_interval ) was used in the body of

Re: Perl Bug (again)

2006-02-20 Thread D D Allen
You're not necessarily wrong... or right.  As indicated by many of the responses, you've used a Perl construct that is an "edge condition" in the language whose behavior isn't well defined.  But it's also a dubious programming construct in any language.  Translating that statement to english, "con

Re: Perl bug?

2006-02-08 Thread D D Allen
Your instinct is correct.  Simplest, most important suggestion:  always "use warnings;" when developing and testing code. Ok... I know you asked not to receive rewritten code -- but your parse / gettoken functions cries out for simplification.   The sole purpose of your two functions is to get th

Win32 API, Directories wwith Unicode / Wide Filenames, FindFirstFileW, FindNextFileW

2006-01-24 Thread D D Allen
I have a Win32 Perl coding challenge to search a directory (WinXP, NTFS) with a file specification pattern where the directory may contain files with unicode / wide filenames in addition to ANSI filenames.   Through trial, error, and searches against Perl mailing list archives, it seems apparent t