From 7a73162607544204032aa66cce755daf21edebda Mon Sep 17 00:00:00 2001 From: Matt Strapp Date: Tue, 24 May 2022 11:18:46 -0500 Subject: Graduate Signed-off-by: Matt Strapp --- csci5271/hw1/hw1p2a.pl | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100755 csci5271/hw1/hw1p2a.pl (limited to 'csci5271/hw1/hw1p2a.pl') diff --git a/csci5271/hw1/hw1p2a.pl b/csci5271/hw1/hw1p2a.pl new file mode 100755 index 0000000..a8bfe2e --- /dev/null +++ b/csci5271/hw1/hw1p2a.pl @@ -0,0 +1,12 @@ +#!/usr/bin/perl +print "Content-Type: text/html\r\n\r\n"; +print "\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 "\n"; \ No newline at end of file -- cgit v1.2.3