http://www.perlmonks.org?node_id=863834


in reply to Re^7: Can't call method "otherwise" without a package or object reference at
in thread Can't call method "otherwise" without a package or object reference at

I'll admit I haven't run the deparse before... so I can't read it very well (at least for this try catch stuff... But For the code that was added simply to prove that otherwise is defined.
do { (my($k) = 2); 'sysAssert'->throw('test assert') }->try('err'->catch(do { (my($ex) = @_); print("caught by with\n"); dPrt('warn', " with $ex") }->with(do { (my($ex) = @_); print("caught by otherwise \n"); dPrt('warn', "OTHERWISE:$ex") }->otherwise)));
For the original offending code that generates the error about can't call method "otherwise"... that I am trying to fix...
if (($pbOnDStarMachine == 1)) { (my($sComm) = "sudo dchown nhmgenda '$$this{'sFullPath'}'"); do { libs::exec("$sComm") }->try('err'->catch(do { (my($ex) = @_); dPrt('warn', "$ex") }->with(do { (my($ex) = @_); dPrt('warn', "OTHERWISE:$ex") }->otherwise))); return(''); }