//Print Time – Perl

A key requirement for any log is to log the time and date of any action taking place in a script.  The command below will print the time to your log in a readable format

print LOG scalar localtime;

The output of this in a log will be as follows;

Thu Nov 27 14:48:48 2008

Note: (LOG) is the log file you adding or appending to

By |2008-11-27T15:50:57+00:00November 27th, 2008|Perl|0 Comments

About the Author: