164

Executing External Commands
External Commands

  • Perl enables you to call external command-line utilities

  • Whenever possible, avoid calling external commands

    • Perl supports a large number of built in functions
    • External commands are generally not portable
    • Often more time consuming (process setup/teardown overhead)

  • There are several methods to execute external commands

    • The open() function
    • The system() function
    • Back-quotes
    • The fork() & exec() functions

  • The native shell is used to execute the command line