The error comes from something like this:
$ perl -e'$x="1"; $x->otherwise'
Can't call method "otherwise" without a package or object reference at
+ -e line 1.
You don't appear to show any method calls to otherwise, unless something ends up being treated as an indirect method call.
$ perl -e'$x="1"; otherwise $x'
Can't call method "otherwise" without a package or object reference at
+ -e line 1.
That would indicate otherwise isn't found as a sub.
$ perl -le'sub otherwise { print "foo" } $x="1"; otherwise $x'
foo
Make sure you properly imported otherwise from whatever module provides it.