[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [docbook-apps] Areaoverlay problem
On Tue, Jun 14, 2011 at 2:06 AM, Mauritz Jeanson <mj@johanneberg.com> wrote:
> | -----Original Message-----
> | From: Kirill Churin
> |
> | Hello! i'm trying to use areasearch/areaoverlay suite from
> | docbook-trunk/imagecon.
> |
> | Areasearch works fine and provides <areas>, but when I run
> | areaoverlay on my XML it says: "Can't parse callout data".
>
>
> This is a little strange. With Perl 5.10, the areaoverlay script works for
> me. But with Perl 5.12, I get that same error message. The problem is in
> this snippet from the makeOverlay subroutine:
>
> while (@coords) {
> while (split(/\s+/, shift @coords)) {
> my $conumber = shift || die "Can't parse callout data.\n";
> my $llcorner = shift || die "Can't parse callout data.\n";
> my $urcorner = shift || die "Can't parse callout data.\n";
>
> I was able to make it work by changing the above to
>
> while (@coords) {
> my @tmp = (split(/\s+/, shift @coords));
> while (@tmp) {
> my $conumber = shift @tmp || die "Can't parse callout data.\n";
> my $llcorner = shift @tmp || die "Can't parse callout data.\n";
> my $urcorner = shift @tmp || die "Can't parse callout data.\n";
>
> The 5.12 behaviour makes sense IMHO (see
> http://perldoc.perl.org/functions/shift.html). Without an ARRAY argument,
> the shift function returns the first element of @_, which is the wrong
> array.
>
> Mauritz
>
>
>
Thanks, your patch works like a charm!
--
Kirill Churin
Jabber: reflexing@reflexing.ru
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]