develooper Front page | perl.perl5.porters | Postings from September 2000

[ID 20000901.008] Scoping (?) oddities with pos()

Thread Next
Mike Guy
September 1, 2000 03:06
[ID 20000901.008] Scoping (?) oddities with pos()
Message ID:
There seem to be funny scoping effects with pos():

#perl -wl
$x = 'a' x 200 . 'b';
{ $x =~ /b/g; };
print pos $x;
{ $x =~ /b/g; $y = pos $x };
print "$y ", pos $x;
print do { $x =~ /b/g; pos $x };
Use of uninitialized value in concatenation (.) or string at - line 5.
Use of uninitialized value in print at - line 5.

Test is with bleedperl, but the same behaviour goes back to at least

Mike Guy

# perl -V
Summary of my perl5 (revision 5.0 version 7 subversion 0) configuration:
    osname=solaris, osvers=2.6, archname=sun4-solaris
    config_args='-dOes -Dusedevel -f'
    hint=previous, useposix=true, d_sigaction=define
    usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
    useperlio=undef d_sfio=undef uselargefiles=define 
    use64bitint=undef use64bitall=undef uselongdouble=undef usesocks=undef
    cc='gcc', optimize='-O', gccversion=, gccosandvers=solaris2.6
    cppflags='-I/usr/local/include -I/opt/local/include -DREG_INFTY=22786'
    ccflags ='-I/usr/local/include -I/opt/local/include -DREG_INFTY=22786'
    stdchar='unsigned char', d_stdstdio=define, usevfork=false
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=4
    alignbytes=8, usemymalloc=y, prototype=define
  Linker and Libraries:
    ld='gcc', ldflags =' -L/usr/local/lib -L/opt/local/lib'
    libpth=/usr/local/lib /opt/local/lib /lib /usr/lib /usr/ccs/lib
    libs=-lsocket -lnsl -ldl -lm -lc -lcrypt
    libc=/lib/, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
    cccdlflags='-fpic', lddlflags='-G -L/usr/local/lib -L/opt/local/lib'

Characteristics of this binary (from libperl): 
  Compile-time options: USE_LARGE_FILES
  Locally applied patches:
  Built under solaris
  Compiled at Aug 30 2000 19:07:04

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About