From owner-freebsd-hackers Sat Jun 9 13:12:54 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from mail.numachi.com (numachi.numachi.com [198.175.254.2]) by hub.freebsd.org (Postfix) with SMTP id B7F3137B401 for ; Sat, 9 Jun 2001 13:12:49 -0700 (PDT) (envelope-from reichert@natto.numachi.com) Received: (qmail 8765 invoked by uid 3001); 9 Jun 2001 20:12:48 -0000 Received: from natto.numachi.com (198.175.254.216) by numachi.numachi.com with SMTP; 9 Jun 2001 20:12:48 -0000 Received: (qmail 58418 invoked by uid 1001); 9 Jun 2001 20:12:48 -0000 Date: 9 Jun 2001 20:12:48 -0000 Message-ID: <20010609201248.58417.qmail@natto.numachi.com> From: reichert@natto.numachi.com To: perlbug@perl.com Subject: oct() doesn't handle binary strings Cc: hackers@FreeBSD.org Reply-To: reichert@numachi.com Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG This is a bug report for perl from reichert@numachi.com, generated with the help of perlbug 1.26 running under perl 5.00503. ----------------------------------------------------------------- [Please enter your report here] From perlfunc(1): oct EXPR ... (If EXPR happens to start off with 0x, interprets it as a hex string. If EXPR starts off with 0b, it is interpreted as a binary string.) But the binary string conversion doesn't seem to work: natto% perl -e 'print oct("0b11000110")."\n"' 0 This is otherwise a valid binary string: natto% perl -e 'print unpack('C', (pack("B8", "11000110")))."\n"' 198 The hex string conversion function does work: natto% perl -e 'print oct("0xC6")."\n"' 198 [Please do not change anything below this line] ----------------------------------------------------------------- --- Site configuration information for perl 5.00503: Configured by markm at Sun Mar 5 13:39:27 SAST 2000. Summary of my perl5 (5.0 patchlevel 5 subversion 3) configuration: Platform: osname=freebsd, osvers=4.0-current, archname=i386-freebsd uname='FreeBSD freefall.FreeBSD.org 4.0-current FreeBSD 4.0-current #0: $Date$' hint=recommended, useposix=true, d_sigaction=define usethreads=undef useperlio=undef d_sfio=undef Compiler: cc='cc', optimize='undef', gccversion=2.95.2 19991024 (release) cppflags='' ccflags ='' stdchar='char', d_stdstdio=undef, usevfork=true intsize=4, longsize=4, ptrsize=4, doublesize=8 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12 alignbytes=4, usemymalloc=n, prototype=define Linker and Libraries: ld='cc', ldflags ='-Wl,-E -lperl -lm ' libpth=/usr/lib libs=-lm -lc -lcrypt libc=, so=so, useshrplib=true, libperl=libperl.so.3 Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' -Wl,-R/usr/lib' cccdlflags='-DPIC -fpic', lddlflags='-Wl,-E -shared -lperl -lm ' Locally applied patches: --- @INC for perl 5.00503: /home/reichert/lib/perl /usr/libdata/perl/5.00503/mach /usr/libdata/perl/5.00503 /usr/local/lib/perl5/site_perl/5.005/i386-freebsd /usr/local/lib/perl5/site_perl/5.005 . --- Environment for perl 5.00503: HOME=/home/reichert LANG (unset) LANGUAGE (unset) LD_LIBRARY_PATH (unset) LOGDIR (unset) PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/ucb:/usr/libexec:/usr/X11R6/bin:/usr/etc:/usr/games:/usr/local/games/bin:/home/reichert/bin:/home/reichert/bin PERL5LIB=/home/reichert/lib/perl PERL_BADLANG (unset) SHELL=/bin/tcsh To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message