http://qs321.pair.com?node_id=642711


in reply to Date and time for log files

Yet another way to do it might be as follows:
#!/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";
Would give you:

my_log.20071004122204.log
update: removed period between date and time to better reflect string from OP.