in reply to lsuser epoch translate

The key difference between your code and atcroft's code above is the quotes. With the double quotes in your example, the shell will replace the $1 before perl gets to see it. Using the single quotes will protect the variable names.
$ echo "19284732 Test message 123456789012345" | perl -pe "s/(\d{8,})/ +scalar localtime $1/e;" Fri Aug 15 12:52:29 2014 Test message 123456789012345 $ echo "19284732 Test message 123456789012345" | perl -pe 's/(\d{8,})/ +scalar localtime $1/e;' Tue Aug 11 23:52:12 1970 Test message 123456789012345

Replies are listed 'Best First'.
Re^2: lsuser epoch translate
by dcronin135 (Acolyte) on Oct 06, 2014 at 01:46 UTC

    You are absolutely right! Don't know how I missed such a simple syntax.