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
January 30, 2001 06:04
[ID 20010130.007] ``printf "%d\n", "1 foo";'' fails in perl 5.6.0
Message ID:

This is a bug report for perl from,
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
	xterm:~ 25> perl -v | grep 'This is perl'
	This is perl, version 4.0
	xterm:~ 26> perl5
	xterm:~ 27> perl5 -v | grep 'This is perl'
	This is perl, version 5.003 with EMBED

	thoreau:~ 118> perl
	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]
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:
    osname=netbsd, osvers=1.5_beta2, archname=alpha-netbsd
    uname='netbsd 1.5_beta2 netbsd 1.5_beta2 (thoreau) #20: tue nov 7 23:53:21 est 2000 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
    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/, 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:

Environment for perl v5.6.0:
    LANG (unset)
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PERL_BADLANG (unset)

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