Skip Menu |

This queue is for tickets about the Integer-Partition CPAN distribution.

Report information
The Basics
Id: 29927
Status: resolved
Priority: 0/
Queue: Integer-Partition

People
Owner: dland [...] cpan.org
Requestors: saverio [...] udayton.edu
Cc:
AdminCc:

Bug Information
Severity: Unimportant
Broken in:
  • 0.01
  • 0.02
Fixed in: 0.03



Subject: bug in Integer-Partition
Date: Thu, 11 Oct 2007 13:24:43 -0400
To: bug-Integer-Partition [...] rt.cpan.org
From: Saverio Perugini <saverio [...] udayton.edu>
Hi, The following code does not actually produce the integer partitions on my system, but rather the appearance of output: Program: #!/usr/bin/perl use Integer::Partition; my $i = Integer::Partition->new(4); while (my $p = $i->next) { print join( ' ', map { "(@$_)" } @$p ), $/; } Output: () () () () () () () () () () () () * Distribution name and version: Integer-Partition-0.02 * Perl version (Find this by running the command perl -v) Summary of my perl5 (revision 5 version 8 subversion 6) configuration: Platform: osname=darwin, osvers=8.0, archname=darwin-thread-multi-2level uname='darwin b07.apple.com 8.0 darwin kernel version 8.3.0: mon oct 3 20:04:04 pdt 2005; root:xnu-792.6.22.obj~2release_ppc power macintosh powerpc ' config_args='-ds -e -Dprefix=/usr -Dccflags=-g -pipe - Dldflags=-Dman3ext=3pm -Duseithreads -Duseshrplib' hint=recommended, useposix=true, d_sigaction=define usethreads=define use5005threads=undef useithreads=define usemultiplicity=define useperlio=define d_sfio=undef uselargefiles=define usesocks=undef use64bitint=undef use64bitall=undef uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cc', ccflags ='-g -pipe -fno-common -DPERL_DARWIN -no-cpp- precomp -fno-strict-aliasing -I/usr/local/include', optimize='-Os', cppflags='-no-cpp-precomp -g -pipe -fno-common -DPERL_DARWIN -no- cpp-precomp -fno-strict-aliasing -I/usr/local/include' ccversion='', gccversion='3.3 20030304 (Apple Computer, Inc. build 1819)', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=8 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='env MACOSX_DEPLOYMENT_TARGET=10.3 cc', ldflags ='-L/usr/ local/lib' libpth=/usr/local/lib /usr/lib libs=-ldbm -ldl -lm -lc perllibs=-ldl -lm -lc libc=/usr/lib/libc.dylib, so=dylib, useshrplib=true, libperl=libperl.dylib gnulibc_version='' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=bundle, d_dlsymun=undef, ccdlflags=' ' cccdlflags=' ', lddlflags='-bundle -undefined dynamic_lookup -L/ usr/local/lib' Characteristics of this binary (from libperl): Compile-time options: MULTIPLICITY USE_ITHREADS USE_LARGE_FILES PERL_IMPLICIT_CONTEXT Locally applied patches: 23953 - fix for File::Path::rmtree CAN-2004-0452 security issue 33990 - fix for setuid perl security issues SPRINTF0 - fixes for sprintf formatting issues - CVE-2005-3962 Built under darwin Compiled at Nov 2 2006 10:37:00 %ENV: PERL5LIB="/sw/lib/perl5:/sw/lib/perl5/darwin" @INC: /sw/lib/perl5 /sw/lib/perl5/darwin /System/Library/Perl/5.8.6/darwin-thread-multi-2level /System/Library/Perl/5.8.6 /Library/Perl/5.8.6/darwin-thread-multi-2level /Library/Perl/5.8.6 /Library/Perl /Network/Library/Perl/5.8.6/darwin-thread-multi-2level /Network/Library/Perl/5.8.6 /Network/Library/Perl /System/Library/Perl/Extras/5.8.6/darwin-thread-multi-2level /System/Library/Perl/Extras/5.8.6 /Library/Perl/5.8.1 . * Operating System vendor and version (Find this by running the command uname -a) Darwin saverio-peruginis-powerbook-g4-15.local 8.10.0 Darwin Kernel Version 8.10.0: Wed May 23 16:50:59 PDT 2007; root:xnu-792.21.3~1/ RELEASE_PPC Power Macintosh powerpc
From: dland [...] cpan.org
On Thu Oct 11 13:25:48 2007, saverio@udayton.edu wrote: Show quoted text
> Hi, > > The following code does not actually produce the integer partitions on > my system, but rather the appearance of output: > > Program: > > #!/usr/bin/perl > > use Integer::Partition; > > my $i = Integer::Partition->new(4); > while (my $p = $i->next) { > print join( ' ', map { "(@$_)" } @$p ), $/; > } > > Output: > > () > () () > () () > () () () > () () () ()
That's because the documentation is wrong. It should of course read: while (my $p = $i->next) { print join( ' ', @$p ), $/; } Sorry about that. I'll update the documentation and push out a new release. The idea is that the iterator returns a simple reference to an array of values. Thanks for taking the time to write up this bug report. David Landgren
Fixed in 0.03, thanks for the report. David