#!/usr/bin/perl -w ## ## Year is 2018 ## NOW: Fri Dec 28 14:27:35 2018 ## Logfile.Dec.28.2018.14:32:49.txt ## use strict; use Time::localtime; printf "Year is %d\n", localtime->year() + 1900; my $now = ctime(); print "NOW: $now\n"; my($day,$mth,$day,$time,$year) = split(/\s+/,$now); system(`touch "Logfile.$mth.$day.$year.$time.txt"`);