sub daemonize { action() or die "$errstr\n"; return 1; } eval { demonize() } or print("error: $@");
# A global could also be used instead of an attribute. sub daemonize { action() or return $self->set_error($errstr); return 1; } $o->demonize() or print("error: " . $o->get_error());
In reply to Re: Returning string and numerical data types from subroutines
by ikegami
in thread Returning string and numerical data types from subroutines
by saurabh.hirani
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |