in reply to XML Stream Freezing during test

I don't think this code is Windows friendly for the following reasons: a) When you are installing you are probably using
perl makefile.pl nmake install nmake nmake test
And you go nutty when you run the 'nmake test'. If you look in the /t folder where you expanded the .gz file you will find various test files with the .t extension. Inside of the buildxml.t file is where your nmake test is hanging up, particularly on line 81:
my $sid = $stream->OpenFile("t/test.xml"); my %status; while( %status = $stream->Process()) ...
Note: I had to change the path on Windows to "..\\t\\test.xml" to even get past this step. More debugging leads me to the infinite loop that is caused by trying to use IO::Select on a filehandle in windows (see line 1221+ in Stream.pm):
my $buff = ""; while($self->{SIDS}->{newconnection}->{status} == 0) { $self->debug(5,"OpenFile: can_read(",join(",",$self->{SIDS}->{ +newconnection}->{select}->can_read(0)),")"); if ($self->{SIDS}->{newconnection}->{select}->can_read(0)) ...
The can_read(0) function returns nothing and no error is generated. You can try this for yourself like this:
C:\Temp\XML-Stream-1.22\t>perl -e "use IO::Select; open(H, qq|c:\\temp +\\foo.cpp|) or die $!; my $n = new IO::Select(H); print $n->can_read( +0); close(H);"
I have tried all sorts of variations of the above using \*STDIN, etc. from the examples in the POD and always got the same result. It just doesn't appear to work on Windows. Bummer. The reality is that you will have to pay special attention to scripts/modules that were not built/tested on Windows because strange things might happen. For instance, last night I ran a script from one of merlyn's articles for creating your own mini CPAN. I started it at around 11:00 p.m. CST in an Emacs shell buffer so that I could look at output in the morning. When I awoke all of the CPAN modules were copied to my machine...and then immediately after they were all ERASED by the same script! The moral? Well, take your pick: MORAL #1) Don't expect everything to work on Windows and MORAL #2) Consider switching to Linux (I am actually leaning toward the latter myself).

Celebrate Intellectual Diversity

Replies are listed 'Best First'.
Re^2: XML Stream Freezing during test
by eric256 (Parson) on Aug 24, 2005 at 20:21 UTC

    Yea i have a linux machine i can do this work on. Just didn't see anything any where to indicate it wouldn't work on windows, and i thought I had it running on windows before. Is this an IO::Select issue then? or just basic incompatibility of ideas?


    ___________
    Eric Hodges