in reply to Matching elements in a array

You are doing it the wrong way round. If $line contains <ch1>, your $1 will contain ch1 after the pattern match and not c([^>]*) which is the key you have in your %allowed hash.

So, match as little as possible in your regexp, e.g

$line =~ /<([^>]+?)\d+?\s*>/;

--shmem

_($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                              /\_¯/(q    /
----------------------------  \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}