Perl-Sensitive Sunglasses | |
PerlMonks |
Re: Help needed with Perl script designed to find files by extension and count the number of charsby Athanasius (Archbishop) |
on May 01, 2015 at 02:24 UTC ( [id://1125325]=note: print w/replies, xml ) | Need Help?? |
Hello again Griegomas, I see you have updated your post to incorporate some of the advice given (but still no strict). In itself, that’s good. However, your re-write of the OP has the unfortunate effect of removing context from the following replies, which makes it hard for monks to follow the thread. For small changes, you can use <strike>...</strike> tags, but for large-scale changes such as this, it would be better to put the update (clearly marked as such) at the foot of the original code. Better still would be to start a new node, since your update includes a new question. This results in an extension like .h finding all files that end with h. That’s because the . has a special meaning within a regular expression. To remove that special meaning — in other words, to get whatever text is in $ARGV[0] to be treated literally — you need to enclose the text within the escape sequence \Q ... \E:
See More on characters, strings, and character classes in perlretut. Hope that helps,
In Section
Seekers of Perl Wisdom
|
|