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

hiii all, my question may look silly i have a file containing n number of characters. i used substr to get 20 charactrs nw i want to check whether my pattern matches within this substr instead of not checking entire file. how to do that

Replies are listed 'Best First'.
Re: checking for pattern match with in a small chunk of data
by AnomalousMonk (Archbishop) on Jun 28, 2012 at 20:08 UTC
Re: checking for pattern match with in a small chunk of data
by ansh batra (Friar) on Jun 28, 2012 at 20:49 UTC

    who is stopping you to do so?
    you are using substr ,so keep the result in a variable and match that variable.