That's because perl parses the part
${imlre{$_}->[1][^>] as
${imlre{$_}->[1]->[^>], hence an attempt to access an array of arrays. This of course cannot work because "^>"
is not numeric isn't a valid Perl expression (that should resolve to something numeric).
You must resolve this abiguity eg like you did in
s/<$imlre{$_}->[1]([^>]*)>//g. Here the () help the perl parser to DWIM.
Update:Followed
ikegami's nit picking ;)