>>> Any ideas?
>>
>> Wrap the use() statement in an if block.
>>
>> if ( $^O eq 'darwin' ) {
>> use POSIX;
>> } else {
>> use POSIX qw(:sys_wait_h);
>> }
>>
>> Will that work?
>
> Only if you wrap that in a BEGIN block. Remember, 'use' happens at
> compile not run time.
Here's what I tried:
**************************************
BEGIN {
if ( $^O eq 'darwin' ) { use POSIX; }
else { use POSIX qw(setsid nice :sys_wait_h); } # line 14
}
**************************************
... but it still errors out:
% sko
":sys_wait_h" is not exported by the POSIX module
Can't continue after import errors at
/System/Library/Perl/5.8.1/darwin-thread-multi-2level/POSIX.pm line 19
BEGIN failed--compilation aborted at /Users/bh/Library/perl/sko line 14.
% perl -e 'print $^O, "\n";'
darwin
Any other ideas?
TIA.
- Bryan
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>