Thursday, May 1, 2008

Perl: Reading output from a Unix command

You can run Unix commands in perl and use the output in your perl program

Example
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:
open(DATE, "date|");
$theDate = ;
close(DATE);

No comments:

Post a Comment