Re: Date function




Sharif Islam wrote:
K.J. 44 wrote:
Hi,

is there a date function in Perl or do I have to try to find a module?

What i need is to be able to come up with the current date, then
subtract one day, and add that to the file name in the form of:

YYYY-MM-DD-RestOfFileName.txt

The script I have written parses these files and I want to run it every
night after midnight on the previous days file which has the naming
convention above.

I am running ActiveState Perl in a Windows environment.


You can use the Date::Format module.

Or just the POSIX module's strftime().

.



Relevant Pages

  • Re: Date function
    ... Sharif Islam wrote: ... I am running ActiveState Perl in a Windows environment. ...
    (comp.lang.perl.misc)
  • Re: Date function
    ... I am running ActiveState Perl in a Windows environment. ... There are built-in functions and modules, and numerous ones in the CPAN ...
    (comp.lang.perl.misc)
  • Re: Date function
    ... I am running ActiveState Perl in a Windows environment. ... use strict ...
    (comp.lang.perl.misc)
  • Re: Foreach Code Issue
    ... > Windows Environment for a windows environment and I'm running ActivePerl ... As someone else pointed out you could just open the file directly in perl. ... You are overwriting the file for each $USERID ... close REPORT1; ...
    (perl.beginners)
  • Re: SFTP from Perl for Windows
    ... SFTP from Perl for Windows ... I need to be able to do file transfers via SFTP from Perl (ActiveState) ... in a Windows environment but I am having trouble finding a suitable Perl ...
    (perl.beginners)