To maximize portability, don't try to launch new processes. That means you should avoid system, exec, fork, pipe, ``, qx//, or open with a |.
The main problem is not the operators themselves; commands that launch external processes are generally supported on most platforms (though some do not support any type of forking). Problems are more likely to arise when you invoke external programs that have names, locations, output, or argument semantics that vary across platforms.
One especially popular bit of Perl code is opening a pipe to sendmail so that your programs can send mail:
This won't work on platforms without sendmail. For a portable solution, use one of the CPAN modules to send your mail, such as Mail::Mailer and Mail::Send in the MailTools distribution, or Mail::Sendmail.open(MAIL, '|/usr/lib/sendmail -t') or die "cannot fork sendmail: $!";
The Unix System V IPC functions (msg*(), sem*(), shm*()) are not always available, even on some Unix platforms.
Copyright © 2001 O'Reilly & Associates. All rights reserved.
HIVE: All information for read only. Please respect copyright! |