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

 @MATCHING = grep /$SEARCH/i, @finfo; working well, but want to anchor to start of line, tried   @MATCHING = grep /^$SEARCH/i, @finfo; but did not get expected result. All help appreciated, thanx

Replies are listed 'Best First'.
Re: Line starting with
by Corion (Patriarch) on Mar 12, 2010 at 14:30 UTC

    Maybe your lines don't start with what's in $SEARCH actually?

    Please post a short, self-contained script and the input data that reproduce the problem. This helps us to help you better.

      Thanx much for your response. I found my problem. I am use Blank line separated records, and my code is not searching for "lines" that start with, but "records" that start with. You have been of help a number of times, and it is appreciated. Thank You