http://qs1969.pair.com?node_id=517495

jithoosin has asked for the wisdom of the Perl Monks concerning the following question:

Hi monks,
I want to know about these 3 statements which are not clearly specified in perlembed

(1) PERL_SYS_INIT3(&argc,&argv,&env);
Is this "argv" parameter is the same as "argv" in "perl_parse".And what is the need of this command?


(2)PL_exit_flags |= PERL_EXIT_DESTRUCT_END;
Why is this needed exactly ?


(3)PERL_SYS_TERM();
What is the use of this command?


Could any one the monks in the perl monastry help me ?

Replies are listed 'Best First'.
Re: undocumented PERLEMBED
by Joost (Canon) on Dec 17, 2005 at 15:51 UTC
    1. Is this "argv" parameter is the same as "argv" in "perl_parse".
      Yes, ofcourse - it's the same variable, after all.

      And what is the need of this command? Why is this needed exactly ?
      The docs say "system-specific tune up of the C runtime environment". I don't know WHAT that means, exactly. I'd treat it as blackbox that's just needed.
    2. Why is this needed exactly ?
      It's the flag that ensures that END blocks get run, as far as I can make out.

    3. What is the use of this command?
      Same as SYS_INIT3. In other words, it's just needed, and I wouldn't concern myself too much with what it does exactly.