in reply to Re^3: Does $> have a little extra magic?
in thread Does $> have a little extra magic?
Using $@ to decide whether eval failed is error prone, in my experience. Instead I end my 'eval' expression with "; 1" and check whether eval returns a true value or not:
my $root= eval { require Win32; 1 } ? Win32::IsAdminUser() : $> == 0;
- tye
|
|---|