dSP;
SV* retval;
- PUSHMARK(sp);
+ PUSHMARK(SP);
perl_eval_sv(sv, G_SCALAR);
SPAGAIN;
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);
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);
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)",
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);
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 */