#!/usr/bin/perl
# w3.13.pl  Use Perls "localtime(function)" instead of going to the
#  Unix date command.  Your programs should not spawn unnecessary processes.

@weekdays = (Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday);

($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst)= localtime(time);

print <<EOT;

  second:		$sec
  minute:		$min
  hour:  		$hour
  day of month:		$mday
  month:		$mon		(0..11)
  year			$year
  week day		$wday		(0..6)
  year day		$yday
  isdst			$isdst

Today is $weekdays[$wday].		Uses subscripting

EOT





