Problems with perlapi and PL_sv_undef

Discussion in 'Perl' started by Mladen Georgiev, Apr 23, 2004.

  1. 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
     
    Mladen Georgiev, Apr 23, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jerry Manner
    Replies:
    2
    Views:
    6,630
    SpaceGirl
    May 30, 2005
  2. Susan Baker
    Replies:
    2
    Views:
    857
    kelvSYC
    Jun 26, 2005
  3. Shelly

    Problems, problems for newbie

    Shelly, Sep 2, 2007, in forum: ASP .Net
    Replies:
    1
    Views:
    2,244
    Shelly
    Sep 3, 2007
  4. Sak Na rede
    Replies:
    0
    Views:
    439
    Sak Na rede
    Jan 30, 2009
  5. Mladen Georgiev

    Problems with perlapi and PL_sv_undef

    Mladen Georgiev, Apr 23, 2004, in forum: Perl Misc
    Replies:
    0
    Views:
    92
    Mladen Georgiev
    Apr 23, 2004
Loading...

Share This Page