# New Ticket Created by  Chris Kelly 
# Please include the string:  [perl #31767]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org:80/rt3/Ticket/Display.html?id=31767 >


This is a bug report for perl from [EMAIL PROTECTED],
generated with the help of perlbug 1.34 running under perl v5.8.5.


-----------------------------------------------------------------
[Please enter your report here]

Open should return false when using $1 as a file handle considering $1 is a read-only 
variable:

$ perl -we'open $1, "/dev/null" or die "open: $!"'

It does not.  Here's the output after dumping $1:

$ perl -we'open $1, "/dev/null" or die "open: $!"; use Data::Dumper; print Dumper \$1;'
$VAR1 = \undef;

Here is when a variable named "$foo" is used as a file handle:

$ perl -we'open $foo, "/dev/null" or die "open: $!"; use Data::Dumper; print Dumper 
\$foo;'
$VAR1 = \\*{'::$foo'};

Attempting to assign to $1 should raise the "Modification of a read-only value 
attempted" exception, right?

I find the fact that open doesn't return false and set $! unexpected behavior and 
would classify the behavior as a bug.

Thanks,

Chris Angell
[EMAIL PROTECTED]

[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags:
    category=core
    severity=medium
---
This perlbug was built using Perl v5.8.0 - Wed Sep  3 05:15:53 PDT 2003
It is being executed now by  Perl v5.8.5 - Thu Aug  5 09:52:16 PDT 2004.

Site configuration information for perl v5.8.5:

Configured by chris at Thu Aug  5 09:52:16 PDT 2004.

Summary of my perl5 (revision 5 version 8 subversion 5) configuration:
  Platform:
    osname=openbsd, osvers=3.3, archname=OpenBSD.i386-openbsd-multi
    uname='openbsd mail.piyeepress.com 3.3 bsdkern#0 i386 '
    config_args=''
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=define
    useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=undef use64bitall=undef uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='cc', ccflags ='-fno-strict-aliasing -pipe -I/usr/local/include',
    optimize='-O2',
    cppflags='-fno-strict-aliasing -pipe -I/usr/local/include'
    ccversion='', gccversion='2.95.3 20010125 (prerelease, propolice)', 
gccosandvers='openbsd3.3'
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=4, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /usr/lib
    libs=-lm -lutil -lc
    perllibs=-lm -lutil -lc
    libc=/usr/lib/libc.so.29.0, so=so, useshrplib=false, libperl=libperl.a
    gnulibc_version=''
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=define, ccdlflags=' '
    cccdlflags='-DPIC -fPIC ', lddlflags='-shared -fPIC  -L/usr/local/lib'

Locally applied patches:
    

---
@INC for perl v5.8.5:
    /usr/local/lib/perl5/5.8.5/OpenBSD.i386-openbsd-multi
    /usr/local/lib/perl5/5.8.5
    /usr/local/lib/perl5/site_perl/5.8.5/OpenBSD.i386-openbsd-multi
    /usr/local/lib/perl5/site_perl/5.8.5
    /usr/local/lib/perl5/site_perl
    .

---
Environment for perl v5.8.5:
    HOME=/home/chris
    LANG (unset)
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin:/usr/local/sbin
    PERL_BADLANG (unset)
    SHELL=/bin/ksh

Reply via email to