P
Peter Michael
Hi,
I am looking for the correct way to deal with error checking when
performing system calls via magic variables, e.g.
use strict;
use English qw(-no_match_vars);
# trying to change UID
$UID = getpwnam "nobody";
The last line will not work for a non-privileged user. One idea to
detect this is
$! = 0;
$UID = getpwnam "nobody";
warn "cannot change uid: $!\n" unless 0 == $!;
Is there any "official way" to deal with error checking for magic
vars?
Thanks for any hints.
Best regards,
Peter
I am looking for the correct way to deal with error checking when
performing system calls via magic variables, e.g.
use strict;
use English qw(-no_match_vars);
# trying to change UID
$UID = getpwnam "nobody";
The last line will not work for a non-privileged user. One idea to
detect this is
$! = 0;
$UID = getpwnam "nobody";
warn "cannot change uid: $!\n" unless 0 == $!;
Is there any "official way" to deal with error checking for magic
vars?
Thanks for any hints.
Best regards,
Peter