Mega Code Archive

 
Categories / Perl / System Functions
 

The system command executes a command and waits until that command completes

# The basic syntax for the system function: $return_value = system(command); # The $return_value will hold an integer.  # You must divide this value by 256 to get the actual return value. By convention, a return value of 0 means OK. #!/usr/bin/perl -w $return_value = system("df"); print "System returned $return_value\n";