M
Mladen Georgiev
Hello!
I'm trying to call a perl subroutine from a C++ program via perlapi.
Here is the perl code
sub SaveDocuments {
my ( $files, @questions ) = @_;
...
}
In that subroutine $files must be array reference.
If I push &PL_sv_undef value for $files (there are no files)
XPUSHs( &PL_sv_undef );
$files is assigned the first element of @questions array (the rest of
parameters array).
Hereis how I fill @questions array in C++ code:
if ( Document->Questions != NULL ) {
for ( int i=0; i < Document->Questions->Count; i++ )
{
XPUSHs(sv_2mortal(newSVpv(Document->Questions,strlen(
Document->Questions ) )));
}
}
Where am I wrong?
Thanks in advance!
Best regards,
Mladen
I'm trying to call a perl subroutine from a C++ program via perlapi.
Here is the perl code
sub SaveDocuments {
my ( $files, @questions ) = @_;
...
}
In that subroutine $files must be array reference.
If I push &PL_sv_undef value for $files (there are no files)
XPUSHs( &PL_sv_undef );
$files is assigned the first element of @questions array (the rest of
parameters array).
Hereis how I fill @questions array in C++ code:
if ( Document->Questions != NULL ) {
for ( int i=0; i < Document->Questions->Count; i++ )
{
XPUSHs(sv_2mortal(newSVpv(Document->Questions,strlen(
Document->Questions ) )));
}
}
Where am I wrong?
Thanks in advance!
Best regards,
Mladen