in reply to Getting Error in character class - Regex

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 ;)


holli, /regexed monk/

Replies are listed 'Best First'.
Re^2: Getting Error in character class - Regex
by ikegami (Patriarch) on Apr 03, 2006 at 15:50 UTC
    It doesn't have to be numeric. Just a valid Perl expression. ^[ is not a valid Perl expression.