in reply to How to get the File creation date

You have to add parenthesis to tell perl what the list is:
$m = (stat $file)[9];

Replies are listed 'Best First'.
Re^2: How to get the File creation date
by soubalaji (Sexton) on Aug 17, 2010 at 15:12 UTC
    I done like this, but i get the answers is dome digit (i.e.) 198768745 how to convert this to date.
      What you have there is the number of seconds since midnight Jan 1 1970. This is known as epoch time. To convert you can use the localtime function, this returns, an array of the date elements by default, however if called in a scalar context it will return a time string, you can force scalar context with the scalar function ot by assigning to a scalar variable

      Alternatively read my sig ;)

      Incidental note, 198768745 represents Mon Apr 19 14:32:25 1976, so either

      • You typed in some random digits rather than the content of (stat $file)[9]
      • You're running a UnixTSS box
      • Or the figure came from somewhere else
      print "Good ",qw(night morning afternoon evening)[(localtime)[2]/6]," fellow monks."