in reply to File parsing
In addition:
If you want to treat the value of $hashnew{$com} as a string literal (avoid regexp semantics), use the \Q...\E construct:
if (/\Q$hashnew{$com}\E/) { # ...
This is highly recommended if $hashnew{$com} comes from untrusted sources (because otherwise it can open a security hole). It also helps avoid weird behaviour or sudden death (in case $hashnew{$com} happens to contains regexp control characters).
If you want to avoid the regexp overhead, you can use index:
if (index($_, $hashnew{$com}) + 1) { # ...
All of the above applies only if you want $hashnew{$com} to behave as a simple substring, not as a sub-regexp. (your post is vague, so I'm guessing)
|
|---|