Paul wrote:
> 
> Just installed Inline this week.
> Bravo. That's the tool I was waiting for. =o)
> 
> One suggestion for the cookbook -- what's the best way to do Boolean
> returns?

Look in '/usr/lib/perl5/5.6.1/ExtUtils/typemap' (or similar). There is a
type 'bool'. That means you can use it in Inline:

----8<----
use Inline C => 'bool is_odd(int n){return n % 2;}';

printf "%d is%s odd\n", ($x = shift), is_odd($x) ? "" : " not";
----8<----

> perl test.pl 42
42 is not odd

Cheers, Brian

-- 
perl -le 'use Inline C=>q{SV*JAxH(char*x){return newSVpvf
("Just Another %s Hacker",x);}};print JAxH+Perl'

Reply via email to