diff --git a/mode/perl.py b/mode/perl.py index 5be2f79..e6a5320 100644 --- a/mode/perl.py +++ b/mode/perl.py @@ -549,6 +549,10 @@ class PerlContext(context.Context): stack.append(t.string) starting = False elif t.name == 'delimiter' and t.string == '}': + if not stack: + # we are totally hosed. start over. ugh. + self.build_name_map() + return stack.pop(-1) if curr: self.namelines[i] = (curr, tuple(stack))