NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
But in terms of making it smaller... (Score:1)
use P5NCI::Attribute library => 'nci_test', path => 'src';
sub double_int
versus
use P5NCI::Easy # *cringe*
library => 'nci_test',
path => 'src',
connect => [ 'double_int:ii' ];
or perhaps
use P5NCI::Simple nci_test => 'src', {
double_int => 'ii',
};
Or maybe some combination or variant.
Have a look at the import syntax for ideas. [cpan.org]
Reply to This
Re:But in terms of making it smaller... (Score:1)
If only want to install a thunk as the name of the bound function, those all work too. This example doesn't really show that using different names here is trivial.
I do think this works on Perl 5.6.1. At least, the only thing I worry about is the attribute trick. (See the first code example on page 232 of Camel 3 for why I don't worry much.)