To run the date command from a Perl program, and read the output
of the command, all you need are a few lines of code like this:
The open() function runs the external date command, then opens
a file handle DATE to the output of the date command.
Next, the output of the date command is read into
the variable $theDate through the file handle DATE.
The following code runs the "ps -f" command, and reads the output:
open(PS_F, "ps -f|");
($uid,$pid,$ppid,$restOfLine) = split;
# do whatever I want with the variables here ...