My bad. Here's the long version.

I have not seen a implementation of $input->param(<red>$1</red>). I assumed it needed to be in a for loop.

I placed the code you supplied into my script (sans for loop) but see nothing happening in the final displayed result (tokens are displayed).

More specifically:

In the template file (which is a html page) there are the following tokens which are wrapped with a variable character that is defined within the script as '$' but can be overridden by passing a different value in the script call (&wrapper=somevalue):

icon -> $icon$ title -> $title$ sort -> $sort$
In my script call, I pass the following parameters:
?file=whatsnew.dat &for=Soaring &in=Area &max=10 &order=desc &sort=Date &icon=address.gif &title=Testing

Of the parameters passed, three should perform replacements. What I am getting back in $page_template after s&r is:

icon -> $icon$ title -> $title$ sort -> $sort$

...as if the search did not find matches. Since this search involves a hash, I am wondering if that is what it is looking for: CGI->HASH(...) vs the value of $input->param(...). My understanding is that the w+ (lookahead) should take care of this.

No errors are displayed.

======================
Sean Shrum
http://www.shrum.net


In reply to Re: Re: Re: Re: Do regex using hash keys to wrapped template tokens by S_Shrum
in thread Do regex using hash keys to wrapped template tokens by S_Shrum

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.