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


in reply to Check for "No child processes" internationally

See perlvar#%! and/or Errno

$ perl -le " print $_, ' ', $!=$_ for 1 .. 1555" |ack child 10 No child processes 128 There are no child processes to wait for. 1406 Cannot create a top-level child window. 1442 The window is not a child window. $ perl -MErrno -le " printf qq/%5s %s\n/ , Errno->$_ , $_ for grep /CH +ILD/, keys %! " 1020 ERROR_KEY_HAS_CHILDREN 8332 ERROR_DS_CHILDREN_EXIST 1442 ERROR_NOT_CHILD_WINDOW 8422 ERROR_DS_CANT_RETRIEVE_CHILD 1406 ERROR_TLW_WITH_WSCHILD 1436 ERROR_CHILD_WINDOW_MENU 129 ERROR_CHILD_NOT_COMPLETE 1021 ERROR_CHILD_MUST_BE_VOLATILE 10 ECHILD 1445 ERROR_NON_MDICHILD_WINDOW 128 ERROR_WAIT_NO_CHILDREN 8613 ERROR_DS_EXISTING_AD_CHILD_NC $ perldoc -v %! %OS_ERROR %ERRNO %! Each element of "%!" has a true value only if $! is set to + that value. For example, $!{ENOENT} is true if and only if the current value of $! is "ENOENT"; that is, if the most rece +nt error was "No such file or directory" (or its moral equiva +lent: not all operating systems give that exact error, and certa +inly not all languages). To check if a particular key is meanin +gful on your system, use "exists $!{the_key}"; for a list of le +gal keys, use "keys %!". See Errno for more information, and a +lso see "$!". This variable was added in Perl 5.005.