in reply to Re^2: Logging deleted files
in thread Logging deleted files

See the perldoc for time

--MidLifeXis

Replies are listed 'Best First'.
Re^4: Logging deleted files
by Anonymous Monk on Oct 23, 2007 at 14:49 UTC
    MidLifeXis, thanks, I did look at this and how I interpret it is that you must have something along the lines of localtime(time). For example, find /tmp/TopLevelDir/SunDir -name 'blah.*' -maxdepth 1 | perl -ne 'chomp; unlink && print localtime(time)." $_\n" | tee -a logfile However, when I run this from the command line I get the a prompt like: > I think I am getting closer but I must be missing something. I will keep playing around with it.

      time() returns an integer representation of the number of seconds since the epoch. If you want a string representation of the time, then you would want scalar(localtime(time)).

      Your immediate problem is that you did not close the single quote starting the perl command (should be a single quote before the | tee to match the one before the chomp).

      Please include <code> and </code> tags around your code and use the preview button to get a look at what other people will see when you post. Code is difficult to read when formatted as HTML.

      --MidLifeXis