View Single Post
  #1  
Old 02-21-2007, 08:37 AM
rjulich rjulich is offline
New Member
 
Join Date: Feb 2007
Posts: 4
Default Results from a system call

Is it possible to put the results from a system call into a variable? I tried:

$variable = system("fgrep date $file");
print "VARIABLE: $variable\n";

The results from the system call print to STDOUT, but when I print $variable, it prints:

VARIABLE: 0

I assume that the system call it returning 0 to mean that the command was successful, but is there a way to put the results from that system call into a variable?

Thank you in advance.
Ray
Reply With Quote