Perl / perl5

🐪 The Perl programming language
https://dev.perl.org/perl5/
Other
1.97k stars 560 forks source link

FileHandle cannot be "our" variables #3023

Closed p5pRT closed 21 years ago

p5pRT commented 23 years ago

Migrated from rt.perl.org#4989 (status was 'resolved')

Searchable as RT4989$

p5pRT commented 23 years ago

From tinne@ls2.cs.uni-dortmund.de

Created by tinnefeld@ls2.cs.uni-dortmund.de

Defining FileHandles as "our" Variables does not seem to work​: \ #!/app/unido-i02/sun4_56/perl/5.6.0/bin/perl

use warnings; use strict; use English; use FileHandle;

our $fh = new FileHandle $PROGRAM_NAME; print \<$fh>; $fh->close; 1 \ results in "Use of uninitialized value in \ at ./MiniTest.pm line 9."

while changing the "our" to "my" in line 8 makes the program output itself\, as presupposed.

Perl Info ``` Flags: category=core severity=high Site configuration information for perl v5.6.0: Configured by tinne at Tue Dec 12 13:02:44 MET 2000. Summary of my perl5 (revision 5.0 version 6 subversion 0) configuration: Platform: osname=solaris, osvers=2.7, archname=sun4-solaris-64int uname='sunos cauchy 5.7 generic_106541-12 sun4u sparc sunw,ultra-5_10 ' config_args='-Dcc=gcc' hint=recommended, useposix=true, d_sigaction=define usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef useperlio=undef d_sfio=undef uselargefiles=define use64bitint=define use64bitall=undef uselongdouble=undef usesocks=undef Compiler: cc='gcc', optimize='-O', gccversion=2.95.2 19991024 (release) cppflags='-I/app/unido-inf/sun4_56/gdbm/1.7.3/include -fno-strict-aliasing -I/usr/local/include -I/opt/local/include' ccflags ='-I/app/unido-inf/sun4_56/gdbm/1.7.3/include -fno-strict-aliasing -I/usr/local/include -I/opt/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64' stdchar='char', d_stdstdio=define, usevfork=false intsize=4, longsize=4, ptrsize=4, doublesize=8 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16 ivtype='long long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=8, usemymalloc=y, prototype=define Linker and Libraries: ld='gcc', ldflags ='-R/app/unido-inf/sun4_56/gdbm/1.7.3/lib -R/usr/local/lib -R/opt/local/lib -R/usr/ccs/lib -L/app/unido-inf/sun4_56/gdbm/1.7.3/lib -R/usr/local/lib -R/opt/local/lib -R/usr/ccs/lib ' libpth=/app/unido-inf/sun4_56/gdbm/1.7.3/lib /usr/local/lib /opt/local/lib /lib /usr/lib /usr/ccs/lib libs=-lsocket -lnsl -lgdbm -ldl -lm -lc -lcrypt -lsec libc=/lib/libc.so, so=so, useshrplib=true, libperl=libperl.so Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' -R /app/unido-i02/sun4_56/perl/5.6.0/lib/CORE' cccdlflags='-fPIC', lddlflags='-G -L/app/unido-inf/sun4_56/gdbm/1.7.3/lib -R/app/unido-inf/sun4_56/gdbm/1.7.3/lib' Locally applied patches: @INC for perl v5.6.0: /app/unido-inf/sun4_55/titrax/1.98/lib/titrax /app/unido-i02/sun4_56/perl/5.6.0/lib /app/unido-i02/sun4_56/perl/5.6.0/site_perl /app/unido-i02/sun4_56/perl/5.6.0/site_perl /app/unido-i02/sun4_56/perl/5.6.0/site_perl . Environment for perl v5.6.0: HOME=/home/tinne LANG (unset) LANGUAGE=de LC_CTYPE=iso_8859_1 LD_LIBRARY_PATH=/app/unido-inf/sun4_55/realplayer/5.0 LOGDIR (unset) PATH=/app/unido-i02/sun4_56/perl/5.6.0/bin:/app/unido-i02/sun4_56/bin:/usr/proc/bin:/app/unido-inf/sun4_56/make/3.78.1/bin:/app/unido-i02/sun4_56/emacs/20.4/bin:/app/unido-inf/sun4_56/kde/1.1.2/bin:/app/unido-inf/sun4_55/textools/96a/bin:/app/unido-i02/sun4_55/ghostscript/6.30/bin:/app/unido-i02/sun4_56/tetex/20000305/bin/sparc-sun-solaris2.6:/app/unido-inf/sun4_56/gcc/2.95.2/bin:/app/unido-inf/sun4_55/purify/4.2/purify-4.2-solaris2:/app/unido-inf/sun4_55/gcc/2.8.1/bin:/app/unido-inf/sun4_56/gnudevenv/1999_09_01/bin:/app/unido-inf/sun4_55/jdk/1.2.1/bin:/app/unido-i02/sun4_56/netscape/4.73/bin:/app/unido-inf/sun4_56/plusenv/1999_11_01/bin:/usr/dt/bin:/usr/ccs/bin:/bin:/usr/ucb:/home/tinne/Solaris/bin:/usr/openwin/bin:/opt/local/bin PERLLIB=/app/unido-inf/sun4_55/titrax/1.98/lib/titrax PERL_BADLANG (unset) SHELL=/usr/local/bin/tcsh ```
p5pRT commented 21 years ago

From @iabyn

(Just reviewing old Perl bugs).

This bug has been fixed in Perl 5.8.0.

Regards\,

Dave M.

p5pRT commented 21 years ago

@iabyn - Status changed from 'open' to 'resolved'