develooper Front page | perl.perl5.porters | Postings from March 2007

[perl #41651] bug in select functiion on ARM

Thread Next
From:
Steve Peters via RT
Date:
March 19, 2007 20:50
Subject:
[perl #41651] bug in select functiion on ARM
Message ID:
rt-3.6.HEAD-1687-1174362640-1752.41651-15-0@perl.org
On Wed Feb 28 21:39:50 2007, liu.wu@intel.com wrote:
> HI,
> 
> When I port the perl-5.8.8 to ARM ( xscale platform ,Big Endian ,
> Montavista Linux professional edition 3.1) .
> 
> But I find it that the select () function in perl can't be work well.
> Such program like this :
> 
>  
> 
> #! /usr/local/bin/perl
> 
> my $bits="";
> 
> my $timeout=3;
> 
> open READ,"html";
> 
> vec($bit,fileno(READ),1)=1;
> 
> while(select($bit,undef,undef,$timeout)){
> 
>         print "select\n";
> 
> }
> 
> The progress is simple. Open the file (the "html " file is exist ) .and
> then call the select function to find out the opened file descriptor 
> 
> Normally , it should print "select " on screen . but unfortunately there
> is nothing left on screen. 
> 
> For test the select system call. I program the c program to test select
> () system call. It can work well. That's also to say that the system and
> c library is no problem. 
> 
> So I doubt there are some problems on select function in Perl. Since the
> select function in Perl depend on select system call.
> 
> I don't know why?
> 
> I was looking forward to your replying 
> 
> Thank you 

Can you try the following Perl program instead?

 #! /usr/local/bin/perl 
my $bits="";
my $timeout=3;
open READ,"html" or die $!;
vec($bit,fileno(READ),1)=1;
select($bit,undef,undef,$timeout) or die $!;

I'm assuming you are getting errors returned from open or select, but since you are not 
handling the errors from those system calls, you are unable to tell there are errors.  

Please let us know if you are not getting any error messages and it is still not working.


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About