in reply to Problem with enable_watch
enable_watch is not documented to return anything or to set $!. Peeking inside the source, it appears that it intentionally returns undef on error, and only on error. However, the error message is a not stored in $! It is accessible via $c->error().
$c->enable_watch($host) or die("Can't enable watch of $host: ", $c->error(), "\n");
For future reference, please wrap computer text such as code in <c>...</c> tags, and use <p> to start each paraphraph
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Problem with enable_watch
by tayun (Initiate) on Feb 01, 2010 at 16:35 UTC | |
by ikegami (Patriarch) on Feb 01, 2010 at 17:14 UTC |