I was able to fix this bug, but I don't know
why it was a bug.
I am finding all the ColdFusion custom tags in my site, and they are formatted like <cf_capitalize> or <cf_confirmbutton Tabindex=98 name="Next">. My regex is returning the stuff after '<cf_' and before any whitespace or '>'. Then I need to append '.cfm' to the returned string. My code below was causing weird things to happen in the hash. It was creating 2 hash keys for this value, and they looked like this:
capitalize
capitalize.cfm1
while ($_ =~ /(<cf_)(.*?)[>\s]/gi) {
# finding custom tags
$uniques{"$2.cfm"}++;
$uniques{$2} = "<cust>";
}
I was able to fix it by removing the .cfm in the above code, like so:
while ($_ =~ /(<cf_)(.*?)[>\s]/gi) {
# finding custom tags
$uniques{"$2"}++;
$uniques{$2} = "<cust>";
}
Then later I append the '.cfm'. Any ideas as to why this was happening to me?
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.