in reply to getting file info?

Also check module File::stat. It replaces core function stat so it provides more nice interface.

Compare these examples:

my $mode = (stat($file))[2];

and

use File::stat; my $mode = stat($file)->mode;

Second variant IMHO is much more readable.