The system command executes a command and waits until that command completes. : system « System Functions « Perl






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";

   
    
    
    
    
    
  








Related examples in the same category

1.Using system on Windows
2.Using system on Windows with the Windows START command
3.Using system to call os/shell function
4.stty cbreak </dev/tty >&1
5.system "stty cbreak &1";
6.Using system to call a command passed in by an array
7.Calling system.
8.Read system command and execute
9.Uses the system function to clear the screen