This Week on perl5-porters (Sep 25 - Oct 03 2004)

This Week on perl5-porters (Sep 25 - Oct 03 2004)

IO::File reads garbage from directory filehandles

Andy Lester reported (bug #31730) that $fh->getline on a directory sometimes returns garbage and other times undef. Steve Peters pointed out that it depends on which OS you're on, which H. Merijn Brand demonstrated on several systems. People blahed at the idea of an argument to IO::File->new to specify the behavior of reading from a directory, though a note in the docs might be okay.

eval {} in XS

Ton Hospel needed an equivalent of eval {} for XS code but didn't find any such thing in the API doc or perl source code, so he made his own. Nick Ing-Simmons explained how in Tk he does eval { &foo } by making a CV for the contents of {} then calling call_sv(cv, G_EVAL). (Note: examine btkGlue.c -- Lang_catch, Tcl_GetRegExpFromObj, and do_comp in the Tk source).

Why do coderefs in @INC clear IoIFP?

Nobody knows apparently. Steve Hay tried not clearing IoIFP, but it caused a test to break.

require Carp; vs use Carp; in

Tels was doing a require Carp instead of use Carp in order to load it on demand, but then found that use vars does use warnings which in turn does use Carp! So he submitted a patch for warnings. Then Vadim Konovalov noted how he always optimizes Dynaloader locally, so he also submitted a patch.

Cannot build bleadperl on OpenVMS

Abe Timmerman, with Craig Berry's help, tried building bleadperl (and porting Test::Smoke) on OpenVMS -- on a VAX. It seems there are problems with 8-level directory names like


If that didn't trigger your VMS allergies, you might try the rest of the thread:

Bug fixes

Chris Kelly was vivified enough to report (bug #31767) that

  open $1, $file or die;

doesn't die. Dave Mitchell fixed it by making open croak if the first argument is read-only. found (bug #31767) that printing from an undef variable prints out junk instead of nothing in perl 5.8.3:

  $data = "13 characters";  $data = undef;
  open(MEM, '<', \$data) or die "Fail: $!\n";
  while (<MEM>) { print }

Rafael Garcia-Suarez fixed this in the development branch.

Zefram (bug #31793) found that use overload wouldn't work when setting the $Data::Dumper::Useqq variable. Rick Delaney provided a patch to fix (with Tels independently arriving at the same conclusion, apparently).

Craig Berry made at least two VMS test fixes:


The thread for bug number $BUGNUM can be found at$BUGNUM

About this summary

This summary was written by Scott Lanning. Summaries are published weekly at and posted to a mailing list whose subscription address is The archive is at Comments and corrections welcome.