#!/usr/local/bin/perl ### Run R from the browser. ### The usual header print "Content-type: text/html\r\n"; print "\r\n"; print "Hello\n"; ### system runs commands from the shell. ### This puts teh date into a file. system("date > date.txt"); ### Here we run R. system("R --vanilla < input.q > out.txt"); ### Now retrieve the ouput and display it (not very pretty) open DATE, "outfile.txt"; while (){ print; } close DATE; print "

"; print "";