Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

time = (stat "$path")[9]; what does the above code means

Replies are listed 'Best First'.
Re: beginner question about stat fucntion
by linuxer (Curate) on May 23, 2009 at 14:13 UTC

    That assigns the "last modify time in seconds since the epoch" of $path to $time (given that your time meant $time).*

    see stat for details.

    * Thanks ww.

      Well, it would mean that if time were $time.
Re: beginner question about stat fucntion
by shmem (Chancellor) on May 23, 2009 at 22:28 UTC

    That's shorthand for

    my @ary = stat $path; $time = $ary[9];

    since stat returns a list. A list can be subscripted.

Re: beginner question about stat fucntion
by Anonymous Monk on May 23, 2009 at 14:25 UTC
    give it up ree