in reply to Date and time for log files
Yet another way to do it might be as follows:
Would give you:#!/usr/bin/perl use Time::localtime; $log_name=sprintf("my_log.%04d%02d%02d%02d%02d%02d.log", localtime->year()+1900, localtime->mon()+1,localtime->mday(), localtime->hour(), localtime->min(),localtime->sec()); print $log_name . "\n";
update: removed period between date and time to better reflect string from OP.my_log.20071004122204.log
In Section
Seekers of Perl Wisdom