perl -ne 'print scalar localtime' < infile > outfile
Notes:
- the "-n" switch, causes perl to assume a "while <>" loop (see perldoc perlrun)
- the $_ can be dropped, because it is implicit
- there is no need to chomp, as you probably want the newline anyway

Cheers,
Darren :)


In reply to Re^5: changing date format in and out by McDarren
in thread changing date format in and out by gio001

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":