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. ENCS is Creating dvi output from LaTeX ... Saving output to 'base.dvi' ... cp: cannot access .Rd2dvi26632/Rd2.dvi Done xdvi-xaw.bin: Fatal error: base.dvi: No such file. <235>% ls base.Rd base.Rd <236>% uname -a SunOS strauss.udel.edu 5.9 Generic_112233-12 sun4u sparc SUNW,Sun-Fire <237>% R --version R version 2.5.1 (2007-06-27) ------------------------------------------------------------------------------- R was installed yesterday (7/25/2007). (I'm not the installer.) Thanks, Larry Hotchkiss Larry Hotchkiss University of Delaware IT User Services -- Smith Hall Newark, DE 19716 302-831-1989 larryh at zebra.us.udel.edu
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."
It seems this feature was introduced in Perl 5.6.1, but that is older than Solaris 9 (which was first released 9/02 according to www.sun.com). We need to know what version of Perl this was. On Thu, 26 Jul 2007, Bill Dunlap wrote:> 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." > > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel >-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595