Five problems unrelated to your question:
- Don't you have warnings turned on!? @FN[1] issues "Scalar value @FN[1] better written as $FN[1]".
- Get rid of chomp $FOUND_FILE;. $FOUND_FILE contains a file name, not a filename followed by a newline.
- $FN_SPLIT doesn't contain a regexp pattern, so /($FN_SPLIT)/ should be /(\Q$FN_SPLIT\E)/.
- The captures in the regexp pattern are a waste of resource. /(\Q$FN_SPLIT\E)/ should be /\Q$FN_SPLIT\E/.
- Finally, the regexp pattern doesn't check for equality. For that, you'd want $FOUND_FILE =~ /^\Q$FN_SPLIT\E\z/ or better yet $FOUND_FILE eq $FN_SPLIT.
Try using
use Data::Dumper;
local $Data::Dumper::Useqq = 1;
local $Data::Dumper::Terse = 1;
print("FOUND_FILE: ", Dumper($FOUND_FILE), "\n");
print("FN_SPLIT: ", Dumper($FN_SPLIT ), "\n");
There's probably leading or trailing spaces.
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.