aboutsummaryrefslogtreecommitdiffstats
path: root/OLD/csci5271/hw1/hw1p2a.pl
blob: a8bfe2ea5b9e07fd8ad535cf032f0e535278516e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
#!/usr/bin/perl
print "Content-Type: text/html\r\n\r\n";
print "<HTML><BODY>\n";
($field_name, $username_to_look_for) = split(/=/, <>);
chomp $username_to_look_for;
$result = `last -1000 | grep $username_to_look_for`;
if ($result) {
print "$username_to_look_for has logged in recently.\n";
} else {
print "$username_to_look_for has NOT logged in recently.\n";
}
print "</BODY></HTML>\n";