Gossamer Forum
Home : General : Perl Programming :

Need help on Parse/substitute pattern

Quote Reply
Need help on Parse/substitute pattern
I have a line I want to parse and substitute.
Example:
$line contains ...
__________________
"the great red fox jumped <%anything%> the fence."
__________________
when read into my subroutine.

I am trying to create some code that will parse the "anything" out of the middle of the <%... and ... %>. (I need this part because I want this extraction so I can take some different actions upon the "anything".)

Then I want to substitute the <%anything%> with $mycontent.

Example:
$mycontent = "quickly over";

Sooooo, I would now want $line after all this code to contain...
$line contains ...
__________________
"the great red fox jumped quickly over the fence."
__________________

Any help on this would be appreciated Smile
Thanks
TimRyan


[This message has been edited by timryan (edited August 14, 1999).]