start page | rating of books | rating of authors | reviews | copyrights

Perl in a Nutshell

Perl in a NutshellSearch this book
Previous: 8.129 SelfLoader Chapter 8
Standard Modules
Next: 8.131 sigtrap
 

8.130 Shell

Allows you to invoke Unix shell utilities as if they were Perl subroutines. Arguments (including switches) are passed to the utilities as strings:

use Shell qw(date cp ps);  # list shell commands you want to use  $date = date();   # put the output of the date(1) command into $date cp("-p" "/etc/passwd", "/tmp/passwd");  # copy password file to a tmp file print ps("-ww");  # print the results of a "ps -ww" command


Previous: 8.129 SelfLoader Perl in a Nutshell Next: 8.131 sigtrap
8.129 SelfLoader Book Index 8.131 sigtrap