in reply to Re^2: File::stats issue
in thread File::stats issue

Oops! Looks like you're using File::stat's stat command as if it were the perl built-in stat()! The first returns an object (or sets fields, potentially). The second returns a list of values, as you are expecting in your code.

Replies are listed 'Best First'.
Re^4: File::stats issue
by basarix (Initiate) on Mar 14, 2005 at 20:37 UTC
    but on the documentation i could find on File::stat, it says that it overrides the functionality of the built in stat(), and gives just ONE example with 1 piece of code that suposedly works with the file mode.... i've not found the man/doc for File::stat very helpful, not does it give a detail of the fields it works with, or in what format are those, hence my problems...
      Yes, but 'overrides' != 'repeats'.

      From File::stat:

      This module's default exports override the core stat() and lstat() functions, replacing them with versions that return "File::stat" objects. ... You may also import all the structure fields directly into your namespace as regular variables using the :FIELDS import tag. (Note that this still overrides your stat() and lstat() functions.)
      and from stat:
      stat Returns a 13-element list giving the status info for a file, either the file opened via FILEHANDLE, or named by EXPR.
      I think the key word there is 'replace'. Nowhere in File::stat does it say that it returns a 13 element list indentical to stat.

      You'll also want to familiarise yourself with the C library stat() function, since that is from where the field names are drawn.