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
The Shell module essentially duplicates the built-in backtick functionality of Perl. The module was written so that its implementation could serve as a demonstration of autoloading. It also shows how function calls can be mapped to subprocesses.
|7.2.55 SelfLoader - Load Functions Only on Demand||7.2.57 sigtrap - Enable Stack Backtrace on Unexpected Signals|