$vchpage = `cat $tmp`; if ($vchpage =~ /File Error/gi){
Works for me
Sounds like you have a problem with what you think you should be expecting.
Print out the contents of $vchpage. If it still looks right, then check for a non-printable char or extra spaces between 'File' and 'Error' in the output of $vchpage.

You should also look at changing your strategy, using 'cat' to run your file into a scalar is not very portable (M$ and Mac do not have 'cat'.), it also decreases your error reporting (what if you don't have permissions?), it also opens you up to strange errors (what if the new version of cat does something strange?)

look at opening the file and stuffing it into a scalar and searching with your regex, or reading the file into an array and greping it on your regex. These are safer solutions.

UPDATE: well Mac OS/X has 'cat' - still not used to a Mac with a real OS :)



grep
These are not the monks you are looking for, move along

In reply to Re: search match within flat text file by grep
in thread search match within flat text file by itsmrchris

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.