in reply to Re: String parameter parsing
in thread String parameter parsing

I don't want the <?Function("foo","bar")?> in $content after the processing. It should be replaced by the output from some_param_stuff(@params);. So I think I need s///. I don't really check for escaped \" either (altho I'm sure MRE mentions it somewhere).

Greetz
Beatnik
... Quidquid perl dictum sit, altum viditur.

Replies are listed 'Best First'.
Re: Re: Re: String parameter parsing
by chipmunk (Parson) on Jan 19, 2001 at 03:31 UTC
    Ah, sorry, I overlooked that bit. In that case, you could just put the substitution back in at the end of my loop.

    Alternatively, the whole thing could be rewritten as a single substitution, with the /e modifier so the replacement will be eval'ed:

    $content =~ s/<\?Function\(([^\)]*)\)\?>/ my $params = $1; my @params = $params =~ m,"([^"]*)",g; some_param_stuff(@params); /ge;
      Muchos kudos :) I'll benchmark it :)

      Greetz
      Beatnik
      ... Quidquid perl dictum sit, altum viditur.