[Rd] Rd2dvi (PR#9812)

Bill Dunlap bill at insightful.com
Thu Jul 26 21:09:24 CEST 2007


On Thu, 26 Jul 2007 larryh at zebra.us.udel.edu wrote:

> Is this a bug--
>
> -------------------------------------------------------------------------------
> <234>% R CMD Rd2dvi base.Rd
> Converting Rd files to LaTeX ...
> base.Rd
> Can't use an undefined value as filehandle reference at
> /opt/R-2.5.1/lib/R/share/perl/R/Rdconv.pm line 78.

This may be due to a change I suggested a while back which
required perl 5.6 (or so) to work.  The change was to ensure
that the file handle rdfile was closed when Rdconv was done
with it.  If this is the problem, upgrading perl to 5.8 will
make it go away.  Rdconv.pm should have a 'use v5.6' (or 5.8?)
line at the top if it wants to continue to use this syntax.

<     open(rdfile, "<$Rdname") or die "Rdconv(): Couldn't open '$Rdfile': $!\n";
<
---
>     open(my $rdfile, "<$Rdname") or die "Rdconv(): Couldn't open '$Rdfile': $!\n";
>     # Before we added the 'my $' in front of rdfile,
>     # rdfile was not getting closed.   Now it will close
>     # when $rdfile goes out of scope.  (We could have added
>     # a close rdfile at the end of the while(<rdfile>), but
>     # scoping method is more reliable.
123c127
<     while(<rdfile>){
---
>     while(<$rdfile>){

----------------------------------------------------------------------------
Bill Dunlap
Insightful Corporation
bill at insightful dot com
360-428-8146

 "All statements in this message represent the opinions of the author and do
 not necessarily reflect Insightful Corporation policy or position."



More information about the R-devel mailing list