develooper Front page | perl.perl5.porters | Postings from January 2001

[ID 20010130.007] ``printf "%d\n", "1 foo";'' fails in perl 5.6.0

Thread Next
From:
simonb
Date:
January 30, 2001 06:04
Subject:
[ID 20010130.007] ``printf "%d\n", "1 foo";'' fails in perl 5.6.0
Message ID:
20010130140348.13126.qmail@mail.netbsd.org

This is a bug report for perl from simonb@thoreau.thistledown.com.au,
generated with the help of perlbug 1.28 running under perl v5.6.0.


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

I have a script I've been using for years that uses printf "%d"
as a short-cut to extract a number from the start of a string.
The test can be boiled down to the following one line script:

	printf "%d\n", "1 foo";

With perl 4.036 and 5.003 (and I believe 5.00404 but I can't
confirm that) this script outputs "1".  With perl 5.6.0 this
outputs "0".

Here's a quick summary of the different versions of perl I
have on different machines:

	xterm:~ 24> perl t1.pl
	1
	xterm:~ 25> perl -v | grep 'This is perl'
	This is perl, version 4.0
	xterm:~ 26> perl5 t1.pl
	1
	xterm:~ 27> perl5 -v | grep 'This is perl'
	This is perl, version 5.003 with EMBED

	thoreau:~ 118> perl t1.pl
	0
	thoreau:~ 119> perl -v | grep 'This is perl'
	This is perl, v5.6.0 built for alpha-netbsd

[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags:
    category=core
    severity=low
---
Site configuration information for perl v5.6.0:

Configured by simonb at Sun Nov 19 23:49:18 EST 2000.

Summary of my perl5 (revision 5.0 version 6 subversion 0) configuration:
  Platform:
    osname=netbsd, osvers=1.5_beta2, archname=alpha-netbsd
    uname='netbsd thoreau.thistledown.com.au 1.5_beta2 netbsd 1.5_beta2 (thoreau) #20: tue nov 7 23:53:21 est 2000 simonb@thoreau.thistledown.com.au:usrobjsysarchalphacompilethoreau alpha '
    config_args='-sde -Dprefix=/usr/pkg -Doptimize=-O2 -Darchname=alpha-netbsd -Dcc=gcc -Dusemymalloc=false'
    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=define uselongdouble=undef usesocks=undef
  Compiler:
    cc='gcc', optimize='-O2', gccversion=egcs-2.91.66 19990314 (egcs-1.1.2 release)
    cppflags='-fno-strict-aliasing -I/usr/pkg/include'
    ccflags ='-fno-strict-aliasing -I/usr/pkg/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
    ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=8, usemymalloc=n, prototype=define
  Linker and Libraries:
    ld='gcc', ldflags =' -L/usr/pkg/lib'
    libpth=/usr/pkg/lib /usr/lib
    libs=-lm -lcrypt
    libc=/usr/lib/libc.so, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E -Wl,-R/usr/pkg/lib '
    cccdlflags='-DPIC -fPIC ', lddlflags='--whole-archive -shared  -L/usr/pkg/lib'

Locally applied patches:
    

---
@INC for perl v5.6.0:
    /usr/pkg/lib/perl5/5.6.0/alpha-netbsd
    /usr/pkg/lib/perl5/5.6.0
    /usr/pkg/lib/perl5/site_perl/5.6.0/alpha-netbsd
    /usr/pkg/lib/perl5/site_perl/5.6.0
    /usr/pkg/lib/perl5/site_perl
    .

---
Environment for perl v5.6.0:
    HOME=/home/simonb
    LANG (unset)
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/home/simonb/bin/netbsd.alpha:/home/simonb/bin:/usr/local/bin:/usr/local/sbin:/usr/local/bin/X11:/usr/pkg/bin:/usr/pkg/sbin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/games:/usr/local/palm/bin:/usr/X11R6/bin
    PERL_BADLANG (unset)
    SHELL=/bin/tcsh



Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About