in reply to Finding item in a text file

I am not exactly sure quite what it is you're trying to do. It would help if you also explained what the output is supposed to look like.

But I think you are asking "how do I do X with Y?" when what you really want to know is "how do I do Y?". Is this meant to be a templating system for a CGI script? If so, there are oodles of already written modules for that purpose available on CPAN to suit just about any taste and purpose. Try to see if one of them fits your bill before you start coding such a thing. perrin's templating system roundup at Perl.com should be a suitable guide for your decision.

Makeshifts last the longest.

Replies are listed 'Best First'.
Re: Re: Finding item in a text file
by Anonymous Monk on Oct 18, 2002 at 20:46 UTC
    The program will generate an entry on the text file, something like:
    <?--1-1--> Something Here or html file. </?--1-1-->

    See this begging tag "<?--1-1-->" and end tag" </?--1-1-->" already exist on the text file.
    I want the program to check if there is a a entry like that in the text file, if it find it
    delete it and print the new one, I hope I have explaing it better, thanks again!!
      I see no place these numbers inside the tags are coming from in your script. Where do you use them in your code? I think you need to post at least some of the code in that if() block to make your intent clearer.

      Makeshifts last the longest.