[win32] various tweaks to makefiles
[p5sagit/p5-mst-13.2.git] / pod / perlembed.pod
index 378a7d6..3209678 100644 (file)
@@ -370,7 +370,7 @@ been wrapped here):
      dSP;
      SV* retval;
  
-     PUSHMARK(sp);
+     PUSHMARK(SP);
      perl_eval_sv(sv, G_SCALAR);
  
      SPAGAIN;
@@ -392,7 +392,7 @@ been wrapped here):
  
  I32 match(SV *string, char *pattern)
  {
-     SV *command = newSV(0), *retval;
+     SV *command = NEWSV(1099, 0), *retval;
  
      sv_setpvf(command, "my $string = '%s'; $string =~ %s",
              SvPV(string,na), pattern);
@@ -413,7 +413,7 @@ been wrapped here):
  
  I32 substitute(SV **string, char *pattern)
  {
-     SV *command = newSV(0), *retval;
+     SV *command = NEWSV(1099, 0), *retval;
  
      sv_setpvf(command, "$string = '%s'; ($string =~ %s)",
              SvPV(*string,na), pattern);
@@ -435,7 +435,7 @@ been wrapped here):
  
  I32 matches(SV *string, char *pattern, AV **match_list)
  {
-     SV *command = newSV(0);
+     SV *command = NEWSV(1099, 0);
      I32 num_matches;
  
      sv_setpvf(command, "my $string = '%s'; @array = ($string =~ %s)",
@@ -456,7 +456,7 @@ been wrapped here):
      char *embedding[] = { "", "-e", "0" };
      AV *match_list;
      I32 num_matches, i;
-     SV *text = newSV(0);
+     SV *text = NEWSV(1099,0);
  
      perl_construct(my_perl);
      perl_parse(my_perl, NULL, 3, embedding, NULL);
@@ -563,7 +563,7 @@ deep breath...
       dSP;                            /* initialize stack pointer      */
       ENTER;                          /* everything created after here */
       SAVETMPS;                       /* ...is a temporary variable.   */
-      PUSHMARK(sp);                   /* remember the stack pointer    */
+      PUSHMARK(SP);                   /* remember the stack pointer    */
       XPUSHs(sv_2mortal(newSViv(a))); /* push the base onto the stack  */
       XPUSHs(sv_2mortal(newSViv(b))); /* push the exponent onto stack  */
       PUTBACK;                      /* make local stack pointer global */
@@ -578,15 +578,12 @@ deep breath...
 
     int main (int argc, char **argv, char **env)
     {
-      char *my_argv[2];
+      char *my_argv[] = { "", "power.pl" };
 
       my_perl = perl_alloc();
       perl_construct( my_perl );
 
-      my_argv[1] = (char *) malloc(10);
-      sprintf(my_argv[1], "power.pl");
-
-      perl_parse(my_perl, NULL, argc, my_argv, NULL);
+      perl_parse(my_perl, NULL, 2, my_argv, (char **)NULL);
       perl_run(my_perl);
 
       PerlPower(3, 4);                      /*** Compute 3 ** 4 ***/
@@ -1013,7 +1010,7 @@ Dov Grobgeld, and Ilya Zakharevich.
 Check out Doug's article on embedding in Volume 1, Issue 4 of The Perl
 Journal.  Info about TPJ is available from http://tpj.com.
 
-April 14, 1997
+July 17, 1997
 
 Some of this material is excerpted from Jon Orwant's book: I<Perl 5
 Interactive>, Waite Group Press, 1996 (ISBN 1-57169-064-6) and appears