in reply to Modifying date/time stamps

I'm not comfortable with the idea of shelling so often. ... I have the feeling TIABWTDI (there is a better way to do it)

Indeed. That entire sequence of shelling out to get date components can be replaced in one of several ways.   perldoc -f localtime will give you info on one approach.

Replies are listed 'Best First'.
Re: Re: Modifying date/time stamps
by BUU (Prior) on Aug 07, 2002 at 06:03 UTC
    and you could replace that huge series of ifs with a @array=qw/jan feb mar.../; $foo=~/(\d+)/;$array[$1]; Basically.
Re: Re: Modifying date/time stamps
by theorbtwo (Prior) on Aug 07, 2002 at 09:30 UTC

    Also, take a look at strftime in POSIX. It'll even let you use your existing format-strings, since date +foo is just a wrapper around strftime.


    Confession: It does an Immortal Body good.