Skip Menu |

This queue is for tickets about the Plucene CPAN distribution.

Report information
The Basics
Id: 12227
Status: resolved
Priority: 0/
Queue: Plucene

People
Owner: Nobody in particular
Requestors: mintywalker [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 1.21
Fixed in: 1.22



Subject: unpack templates and older perl versions (pre 5.8)
The attached patch file fixes a dependency on a perl 5.8 feature of pack/unpack. It thus allows Plucene to remain backwards compatible to perl 5.6.1 The bug can be reproduced by running the unit tests (make;make test) using a perl version prior to 5.8 For more details see the bottom half of: http://www.kasei.com/pipermail/plucene/2005-March/000339.html and all of http://www.kasei.com/pipermail/plucene/2005-April/000353.html Note that this patch implements the "compile time folding", such that newer perls use the templating feature of unpack, where older perls figure it out the hard way.
46a47,48 > use constant PERL_VERSION => $]; > 185c187,199 < my @fields = unpack "w/(w/aC)", read_file($file->[1]); --- > my @fields; > # pack templates don't exist prior to 5.8 > # see perlpacktut.html section on Template-Grouping > if (PERL_VERSION >= 5.008) { > @fields = unpack "w/(w/aC)", read_file($file->[1]); > } > else { > my $data = read_file($file->[1]); > my $count = unpack "w", $data; > my $template = "w" . ("w/a*C" x $count); > my $null; > ($null, @fields) = unpack $template, $data; > }
From: mintywalker [...] gmail.com
oops apply to: lib/Plucene/Index/FieldInfos.pm
[guest - Sun Apr 10 05:24:14 2005]: Show quoted text
> The attached patch file fixes a dependency on a perl 5.8 feature of > pack/unpack.
This should probably be closed as Plucene now depends on perl 5.8 for other reasons.