Created
May 8, 2020 18:54
-
-
Save lanejames35/f7f90b2db038d0628938ff81ef761614 to your computer and use it in GitHub Desktop.
Timesheet generator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############### | |
# Generate a time sheet entry | |
############### | |
#!/usr/bin/perl | |
# Formats for month names | |
@months = qw( Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec ); | |
@weekdays = qw( Mon Tue Wed Thurs Fri Sat Sun ); | |
# get todays date | |
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(); | |
# try to open the file | |
open(DATA, ">>timesheet.csv") || die "Could not open the file"; | |
# append a recrod | |
print DATA "$weekdays[$wday] $months[$mon] $mday,07:00,15:00,1hr\n"; | |
# close the file and clear the buffer | |
close(DATA) || die "Could not close the file"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment