I ran that code as-is, in two conditions:
- (inadvertently) in a directory where I did not have write permission; the result was consistently "-1" as you reported.
- (after seeing my initial mistake) in a directory where I did have write permission; the result was "0" -- i.e. there was one element returned by $sel->can_write(); given that the file had been opened successfully
(this is on macosx 10.3/perl 5.8.1)
That'll teach us about forgetting to do error checking -- i.e. "open ... or die ..." would have been prudent.