Due Thursday, June 21, at the start of class.
Find a working Perl system and make sure that you can write and run Perl scripts there.
Essentially, this exercise is to make sure that you have a working Perl environment to use for the rest of the course. Complete these steps:
#!/usr/bin/perl # Homework for CS 368-3 # Assigned on Day 01, 2012-06-18 # Written by Tim Cartwright use strict; use warnings; use Sys::Hostname; use POSIX 'strftime'; print "My name is [REPLACE WITH YOUR OWN NAME]\n"; print "CS 368 homework 01\n"; print "time = '" . strftime('%Y-%m-%d (%a) %H:%M:%S %Z', localtime()) . "'\n"; print "hostname = '" . hostname . "'\n"; print "program = '$0'\n"; print "exec = '$^X'\n"; print "version = '$]'\n"; # remove the last line if using Windows print "username = '" . (getpwuid($<))[0] . "'\n";
perl homework-01.pl
Normally, you will do each homework by yourself. But in this case, you may ask for help from anyone who knows how to get Perl running on your machine. Be sure to use a machine that you can use for the rest of the class, because you really want to make sure Perl is working right…
A printout of your output on a single sheet of paper. Be sure to put your own name in the “[REPLACE WITH YOUR OWN NAME]” part of the code. Identifying your work is important, or you may not receive appropriate credit.