Problem loading OLE.dll on Windows 98

2006-02-08 Thread Thomas Mostrup Nymand
Hi I am running an installation of Cygwin and the bundled perl5.8 + Win32 on Windows 98. When I try to use Win32::OLE as in the following script: #!/usr/bin/perl use Win32::OLE qw(EVENTS); my $IE = Win32::OLE-new(InternetExplorer.Application) || die Could not start Internet

Re: matrix writing in a file

2006-02-08 Thread $Bill Luebkert
Here's a test snippet for doing something like this without the help of a module : use strict; use warnings; my $file = 'training.txt'; my @matrix; my @matrix2; open OUT, $file or die create $file: $! ($^E); for (my $x = 0; $x 26; ++$x) { for (my $y = 0; $y 26; ++$y) {

Perl bug?

2006-02-08 Thread John Deighan
I realize that most things that look like bugs in Perl are in reality programmer bugs, but I can't figure out why the second call to the function parse() in the code below fails. According to my debugger (from ActiveState's Perl Development Kit), the function parse() gets a correct list of 3

matrix writing

2006-02-08 Thread Ed Chester
you may be interested in pdl, see pdl.perl.org. it might make your whole matrix life easier. ed c ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Testing for Directories

2006-02-08 Thread Dirk Bremer
What is the easiest method to detect whether or not a directory exists? I will need to create the directory/subdirectory if it is not already present. The file test -d does not seem to do the trick. Is there a quick and low-overhead method of doing this without actually trying to open the

Re: Perl bug?

2006-02-08 Thread Luke Bakken
This should illustrate what is going on: use strict; my $lTokens = [qw(2 * 2)]; print 1 before parse: , $lTokens, \n; my $errmsg = parse($lTokens); print($errmsg ? ERROR: $errmsg\n : OK\n); $lTokens = [qw(2 * 2)]; print 2 before parse: , $lTokens, \n; my $errmsg = parse($lTokens); print($errmsg

RE: Problem identifying Win32 Type

2006-02-08 Thread Sturdevant, Robert W. C-E LCMC SEC-Lee SSC
Hi Howard, thanks for the response. This ought to be pretty simple, BUT... I looked at Win32::GetOSVersion() several months ago but it doesn't seem to differentiate between Win 2000 Svr and Pro. Here is a quick example that provides the same output for both Svr and Pro. It doesn't appear to pull

RE: Testing for Directories

2006-02-08 Thread Wagner, David --- Senior Programmer Analyst --- WGO
[EMAIL PROTECTED] wrote: What is the easiest method to detect whether or not a directory exists? I will need to create the directory/subdirectory if it is not already present. The file test -d does not seem to do the trick. Is there a quick and low-overhead method of doing this without

Re: Testing for Directories

2006-02-08 Thread pDale
On 2/8/06, Dirk Bremer [EMAIL PROTECTED] wrote: What is the easiest method to detect whether or not a directory exists? I will need to create the directory/subdirectory if it is not already present. The file test -d does not seem to do the trick. Can you give an example where -d fails? --

Re: Perl bug?

2006-02-08 Thread John Deighan
At 12:10 PM 2/8/2006, Glenn Linderman wrote: On approximately 2/8/2006 6:40 AM, came the following characters from the keyboard of John Deighan: I realize that most things that look like bugs in Perl are in reality programmer bugs, but I can't figure out why the second call to the function

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 the

RE: Testing for Directories

2006-02-08 Thread Dirk Bremer
It turns out that in a very long pathname that I had one-byte that was incorrect that was causing the file-test -d operator to fail, rightly so. My mistake! Dirk Bremer - Senior Systems Engineer - ESS/AMS - NISC Lake St. Louis MO - USA Central Time Zone 636-755-2652 fax 636-755-2503 [EMAIL

Can sleep() be conditional?

2006-02-08 Thread Todd Morrison
Hello! I was wondering if anyone knows/has had experience with using sleep() in a conditional context. For example... for ($x=0; $x= 10; $x++) { print $x\n; # if x is equal to 5, sleep for 5 seconds if ($x == 5) { sleep(5); } } What I wanted to accomplish with this

RE: Can sleep() be conditional?

2006-02-08 Thread Jan Dubois
On Wed, 08 Feb 2006, Todd Morrison wrote: I was wondering if anyone knows/has had experience with using sleep() in a conditional context. For example... for ($x=0; $x= 10; $x++) { print $x\n; # if x is equal to 5, sleep for 5 seconds if ($x == 5) { sleep(5); } }

Re: Perl bug?

2006-02-08 Thread Lyle Kopnicky
Glenn Linderman wrote: So, $lTokens is a reference from a sub, to a variable declared outside of the sub (specifically, to the $lTokens declared in parse on its first invocation), thus making gettoken a closure and causing that instance of $lTokens to be preserved as part of the state of

Re: Perl bug?

2006-02-08 Thread John Deighan
At 03:09 PM 2/8/2006, Glenn Linderman wrote: Now that I understand the situation, I can offer the following as a way to safely do what I was trying to do in the first place - by creating an anonymous function and assigning it to a variable named $gettoken, then calling it with the syntax

RE: Can sleep() be conditional?

2006-02-08 Thread Francis Paulin
Hello Todd, It's weird, because I tried your piece of code and it work the way you expect it to work: Print 0 to 5, wait 5 seconds print 6 to 10. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Todd Morrison Sent: Wednesday, February 08, 2006 3:29 PM To:

Re: Testing for Directories

2006-02-08 Thread Chris Wagner
At 11:13 AM 2/8/2006 -0600, Dirk Bremer wrote: What is the easiest method to detect whether or not a directory exists? I will need to create the directory/subdirectory if it is not already present. The file test -d does not seem to do the trick. Is there a What's wrong with -d? It works for me.

Re: Perl bug?

2006-02-08 Thread Chris Wagner
At 09:10 AM 2/8/2006 -0800, Glenn Linderman wrote: So, $lTokens is a reference from a sub, to a variable declared outside of the sub (specifically, to the $lTokens declared in parse on its first invocation), thus making gettoken a closure and causing that instance of $lTokens to be

Re: Perl bug?

2006-02-08 Thread Lyle Kopnicky
Glenn Linderman wrote: On approximately 2/8/2006 1:06 PM, came the following characters from the keyboard of Lyle Kopnicky: Thanks for the explanation. As far as I am concerned, then, perl's closure model is unintuitive and broken. It doesn't work like closures in any other language I have

Re: Problem loading OLE.dll on Windows 98

2006-02-08 Thread Foo Ji-Haw
When I try to use Win32::OLE as in the following script: #!/usr/bin/perl use Win32::OLE qw(EVENTS); my $IE = Win32::OLE-new(InternetExplorer.Application) || die Could not start Internet Explorer.Application\n; I get the following error: Can't load

Re: XML from DB - well formed

2006-02-08 Thread Foo Ji-Haw
Mario Sanchez wrote: hello everyone, can you please point me to a package or script that will first determine the columns of a database table, then output well formed XML? condition: i do not know in advance the columns of the table. example output where field = actual field name table

Re: Testing for Directories

2006-02-08 Thread Foo Ji-Haw
Dirk Bremer wrote: What is the easiest method to detect whether or not a directory exists? I will need to create the directory/subdirectory if it is not already present. The file test -d does not seem to do the trick. What's wrong with -d? It' is not a file test. It's a test if the path

Re: Perl bug?

2006-02-08 Thread Chris Wagner
At 06:53 PM 2/8/2006 -0800, Glenn Linderman wrote: My understanding is that in a file foo.pl my global_foo; sub counter { return global_foo++; } that sub counter is a closure, which probably is even further outside your thought processes-- I was surprised to learn that from Dave, but given

Re: Testing for Directories

2006-02-08 Thread Rod Butcher
Foo Ji-Haw wrote: Dirk Bremer wrote: What is the easiest method to detect whether or not a directory exists? I will need to create the directory/subdirectory if it is not already present. The file test -d does not seem to do the trick. What's wrong with -d? It' is not a file test. It's a

Re: Testing for Directories

2006-02-08 Thread $Bill Luebkert
Rod Butcher wrote: Foo Ji-Haw wrote: Dirk Bremer wrote: What is the easiest method to detect whether or not a directory exists? I will need to create the directory/subdirectory if it is not already present. The file test -d does not seem to do the trick. What's wrong with -d? It' is not a