Dermot <paik...@gmail.com> writes:

First, thanks for you helpful input and examples.

I'm taxing peoples patience I suppose but being considerably thick of
skull I cannot just look at this and see what it does.

> my @files = map { $_->[0] }
>                    sort { $a cmp $b }
>                    map {[$_, (stat("$dir/$_"))[9] ] }
>                    grep { ! /^\./ && -f "$dir/$_" } readdir($dh);

my @files = map { $_->[0] }  # What happened there?

   sort { $a cmp $b } # I now this sorts stuff, but not sure how or
                      # what kind of sort

perldoc -f cmp  Tells you only to find the meaning in perlop

perldoc perlop - /cmp

Looking at every appearance of `cmp'... I still do not know what the
heck it does.  I did find out that it returns 1 or 0.  Seems kind of
thin to help me understand what it does.

 map {[$_, (stat("$dir/$_"))[9] ] } ## I see a stat is done and
                                    # modtime extracted what else
                                    # happens here?


-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to