Perl Programming/Keywords/stat

The stat keyword
stat returns a list with 13 elements with the status information for a file that is either opened with the DIRHANDLE or FILEHANDLE, or by an EXPRESSION. Without the EXPRESSION, $_ is stat. If the operation fails, it returns an empty list.

If the variable list VARIABLES of <tt>stat</tt> has more than one element, the list has to be placed in brackets. In such a list, <tt>undef</tt> can be used as a placeholder.

If more than one <tt>stat</tt> with the same name are declared within the same lexical scope, Perl issues a warning, as it is the case with multiple <tt>my</tt> declarations, but they are seen as redundant.

<tt>stat</tt> variables can only be used with the <tt>use feature "state"</tt> pragma, unless it is written fully as <tt>CORE::state</tt>.