Copyright © tutorialspoint.com

PERL system Function


Syntax

system PROGRAM, LIST

system PROGRAM


Definition and Usage

Executes the command specified by PROGRAM, passing LIST as arguments to the command.

The return value is the exit status of the program as returned by the wait function. To obtain the actual exit value, divide by 256.

Return Value

  • Exit status of program as returned by wait

Example

Try out following example:

#!/usr/bin/perl -w

system("ls -F /var > /tmp/t.tmp");

It will produce following result:

A file in /tmp direcory, check it out.

Copyright © tutorialspoint.com