[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]

[ID 20000119.007] truncate() does not work on iorefs or globrefs




This is a bug report for perl from dhd@blood-axp.eradicator.org,
generated with the help of perlbug 1.26 running under perl 5.00503.


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

This code:

#!/usr/bin/perl
sub foo {
         local *I;
         open I, ">bar" or die $!;
         print I "quux";
         return *I{IO}
}

$i = foo;
seek $i,0,0 or die "seek: $!";
truncate $i,0 or die "trunc: $!"
__END__

Gives this output:

dhd@blood-axp:~$ perl footest
trunc: No such file or directory at footest line 11.

If I change *I{IO} to \*I, it still does not work.
If I change *I{IO} to  *I, then it does work.

I imagine someone has already reported this problem...

[Please do not change anything below this line]
-----------------------------------------------------------------

---
Site configuration information for perl 5.00503:

Configured by chris at Mon Dec 20 08:37:50 EST 1999.

Summary of my perl5 (5.0 patchlevel 5 subversion 3) configuration:
  Platform:
    osname=linux, osvers=2.2.14pre9, archname=alpha-linux
    uname='linux spawn 2.2.14pre9 #2 wed dec 15 00:24:37 est 1999 alpha unknown '
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef useperlio=undef d_sfio=undef
  Compiler:
    cc='cc', optimize='-O2', gccversion=2.95.2 19991109 (Debian GNU/Linux)
    cppflags='-Dbool=char -DHAS_BOOL -D_REENTRANT -DDEBIAN -I/usr/local/include'
    ccflags ='-Dbool=char -DHAS_BOOL -D_REENTRANT -DDEBIAN -I/usr/local/include'
    stdchar='char', d_stdstdio=undef, usevfork=false
    intsize=4, longsize=8, ptrsize=8, doublesize=8
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=8
    alignbytes=8, usemymalloc=n, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib
    libs=-lnsl -lndbm -lgdbm -ldbm -ldb -ldl -lm -lc -lposix -lcrypt
    libc=, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
    cccdlflags='-fPIC', lddlflags='-shared -L/usr/local/lib'

Locally applied patches:
    

---
@INC for perl 5.00503:
    /usr/lib/perl5/5.005/alpha-linux
    /usr/lib/perl5/5.005
    /usr/local/lib/site_perl/alpha-linux
    /usr/local/lib/site_perl
    /usr/lib/perl5
    .

---
Environment for perl 5.00503:
    HOME=/home/dhd
    LANG=C
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/bin:/usr/bin:/usr/bin/X11:/usr/local/bin:/usr/games
    PERL_BADLANG (unset)
    SHELL=/bin/bash


Follow-Ups from:
Gurusamy Sarathy <gsar@ActiveState.com>

[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]