in reply to System call problem
Better yet from a performance standpoint, spare yourself a system call and use the builtin localtime, à la:
sub get_date { my @time=(localtime)[3..5]; $time[2]+=1900; $time[1]++; foreach ($time[1], $time[0]) { $_ = '0'.$_ if $_ < 10; } "$time[2]$time[1]$time[0]"; }
Yes, it's wordier, but adding this to your toolkit will allow you to cut n' paste it wherever you need it; you can also stick it in a module.
Philosophy can be made out of anything. Or less -- Jerry A. Fodor
|
|---|