On Tuesday 17 June 2008 21:06:32 Sisyphus wrote:
> However, both Inline::CPP and InlineX::CPP2XS have no problem with the
> following form of the version() function:

Sorry for all the extra replies, but in implementing my workaround, I got the 
bug again. :)

This one strikes me as especially curious. As you can see below, the code is 
read into a global which Inline::CPP (should be) treating as a string. The 
method resolution issue crops up again here.

Note: If I paste the code out of the file that's read into the string 
wholesale into a heredoc, it works fine.

----

package MIME::KDE;

use warnings;
use strict;
use version qw(qv);

our $VERSION = qv('0.01');
our $CODE = "";

use File::Basename qw(dirname);

BEGIN {
    open(CPP, dirname(__FILE__).'/src/mimelib.cpp')
       || die "Couldn't locate C++ stub: $!";

    local $/ = undef;

    $CODE = <CPP>;
    close(CPP);

    print STDERR "$CODE\n";
};

use Inline CPP => 
                Config => 
                        LIBS => ['-lkio', '-lkdecore'],
                        INC  => 
['-I /usr/include/kde', '-I /usr/include/qt3'],
                        ENABLE => 'STD_IOSTREAM'
           ;
use Inline CPP => "$CODE";

Reply via email to