OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: RE: [docbook-apps] Areaoverlay problem


|  -----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




[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]