prasanthpronda has asked for the wisdom of the Perl Monks concerning the following question:

This node falls below the community's minimum standard of quality and will not be displayed.

Replies are listed 'Best First'.
Re: HELP-MULTILINE PATTERN MATCHING
by Your Mother (Archbishop) on Feb 17, 2010 at 20:48 UTC
    Please write me a program for the same. It will help.

    Please clean my gutters for me. It will also help.

    Seriously. Show some code you've tried if you want guidance or offer to pay someone privately if all you want is code written. Some relevant documentation you might read to get started on your own includes the top stuff here perlre and open.

Re: HELP-MULTILINE PATTERN MATCHING
by pemungkah (Priest) on Feb 17, 2010 at 21:47 UTC
    On the off-chance that this is simply a communications problem, and what you really meant was "can you explain what I'd need to do to solve this problem" (though it smells heavily of a take-home interview question...). I am only going to very basically outline a possible solution.
    1. Slurp the whole file in at once. (hint: $/).
    2. Use a pattern match that captures the text between the start and end markers. You'll want the /sm modifiers on the match to make sure you cross line boundaries. (Hint: \t is a tab.)
    3. Print the captured text.
    I'd estimate this to be a very small program. If you're over 20 lines you're overthinking it.

    If what I've said here isn't helpful, you really need to settle in with a good Perl tutorial and learn some of this stuff. I recommend Learning Perl as a good start, or here: http://www.perl.com/pub/a/2000/10/begperl1.html.

    I am concerned that you're just hoping for a solution. If you read around on Perlmonks you'll find that we seldom just write someone a program. If they post at least a "Here's the code I tried, but this part doesn't work", yes, very often there'll be a "here's a way to solve that" with a partial or even complete solution.

    But a plain old "write this for me" smacks of "I can't be bothered to do this myself, I'll take advantage of these people's willingness to write code for free" at best, and seems dishonest at worst - be sure that if you "solve" a problem by getting an answer from Perlmonks, sooner or later it will catch up with you. Managers know how to do web searches too, and the good ones will. (A quick search on strings from your example file input turns up this node, for instance.)

Re: HELP-MULTILINE PATTERN MATCHING
by ww (Archbishop) on Feb 17, 2010 at 21:32 UTC
Re: HELP-MULTILINE PATTERN MATCHING
by ikegami (Patriarch) on Feb 17, 2010 at 22:43 UTC
    Assuming the blocks can't be nested,
    perl -ln0777e'print /start:(.*?)end:/gs' input.txt