The following perl program doesn't work. I have copied this to temp.pl
and executed "perl temp.pl"
use Inline C => Config => Structs => ['Foo'];
my $obj = Inline::Struct::Foo->new;
$obj->num(10);
$obj->str("Hello");
myfunc($obj);
__END__
__C__
struct Foo {
int num;
char *str;
};
void myfunc(Foo *f) {
printf("myfunc: num=%i, str='%s'\n", f->num, f->str);
}
OUTPUT : I get the following error
Can't locate object method "new" via package "Inline::Struct::Foo"
(perhaps you forgot to load "Inline::Struct::Foo"?) at temp2.pl line 1.
Any suggestion is appreciated
Thanks & Regards
Sridevi