On Friday, November 1, 2019 1:49:31 AM CET Maggie Q Roth wrote:
> If Net::Ping gets failure and has the special statement for the failure,
> how can return this statement to the caller?
The ping() method never fails, see https://metacpan.org/pod/Net::Ping .
Return returns by returning, like
Hello,
You don't need to setup $!. It is a global variable.
In the documentation I referenced it says:
"When referenced, $! retrieves the current value of the C errno integer
variable. If $! is assigned a numerical value, that value is stored in errno
. When referenced as a string, $! yields the
If Net::Ping gets failure and has the special statement for the failure,
how can return this statement to the caller?
Thank you.
On Fri, Nov 1, 2019 at 5:30 AM Andy Bach wrote:
> > How do I let the caller know what happens when the method fails to run?
>
> As noted, die() ends the program at
Thank you. how to setup $! in module, and how can I get the $! in caller?
regards.
On Fri, Nov 1, 2019 at 4:56 AM Dermot wrote:
> Hi,
>
> You cannot return `die`, die is a fatal exception that causes`test.pl` to
> exit immediately.
> One option would be to use warn to emit a warning to STDERR
> How do I let the caller know what happens when the method fails to run?
As noted, die() ends the program at that point, sending the text to stderr
and setting an exit code to the shell. If you want your subs are to
communicate with their calling code, you can use the return values to show
Hi,
You cannot return `die`, die is a fatal exception that causes`test.pl` to
exit immediately.
One option would be to use warn to emit a warning to STDERR and return to
the caller and let them handle the failure. You may as well add the $! to
the output so the caller gets a copy of the last