And the other try / catch blocks work in the same sub, so the stuff is defined. It has to be something about this particular use of it... like a simple syntax error (I checked for the semi-colon on the end) or the a unique exception coming from inside, but I thought the otherwise should handle any exception type...package err; use da qw(/.*/); use dbg qw(/.*/); use base qw(Error); use overload ('""' => 'stringify'); sub new { prtDbgSubInfo(); my ($pkg,$text) = @_; my @args = (); local $Error::Depth = $Error::Depth + 1; local $Error::Debug = 1; # Enables storing of stacktrace my ($this) = $pkg->SUPER::new(-text => $text, @args); my ($stack) = $this->stacktrace; $stack =~ s#$text #$text\n\t#; #adds a newline after the text and before the first at ... my ($preMsg) = "\n--Error--"; $this->{-text} = "$preMsg\n$stack"; return($this); }
In reply to Re^2: Can't call method "otherwise" without a package or object reference at
by rpelak
in thread Can't call method "otherwise" without a package or object reference at
by rpelak
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |