in reply to Check for "No child processes" internationally
I don't think that "No child process" is locale sensitive, but on some platforms could produce "No children" instead (citation). However, you can ignore the error message's text by remembering that $! is a dual-valued variable; In string context it returns the error message. In numeric context, it returns the error number, which can be tested against the &Errno::ECHILD constant (Errno).
Or you can use %! in some variant on the example code shown in Errno's POD:
# A variation on Errno's POD example: use Errno qw( ECHILD ); # ........ if ( not close $something ) { if( not $!{ECHILD} ) { die "Houston, we have a problem: $!"; } else { # Silence is golden; ECHILD is silent. } }
Dave
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Check for "No child processes" internationally
by Anonymous Monk on May 09, 2013 at 06:58 UTC | |
by davido (Cardinal) on May 09, 2013 at 07:02 UTC |