CIS525 - Lecture#21 - November 15, 2000

Perl: flock(FILE,2); # exclusive lock, before you open flock(FILE,8); # unlock, before you close $file = "mydata.txt"; if(!(-e $file)) <- test for file existance before attempting to open server side includes: please note: the space following <!-- needs to be removed for these directives to behave as includes and not html comments <a href="a.cgi">a.cgi</a> <- a.cgi is a compiled c++ prog <!-- #include virtual="a.cgi"--> <pre> <!-- #echo var="DATE_GMT"--> <!-- #echo var="SERVER_NAME"-> <!-- #exec cmd="cal"--> <- gives a default calendar for current month in Unix <!-- #exec cmd="finger bmaxim"--> <!-- #exec cmd="man unzip"--> <!-- #exec cgi="a.pl"--> <!-- #exec cgi="a.out"--> <- where a.out is a compiled c++ program <!-- #exec cgi="a.cgi"--> <!-- #config errmsg="if error occurs, contact bmaxim@umich.edu"--> </pre> forms:

see www.jdonohue.com/perl2/ for a variety of Perl examples