Help for this page

Select Code to Download


  1. or download this
    opendir(LOGS,".");   
    sort @val = map { -M $_ } grep(/.*\.log/,readdir(LOGS));
    
  2. or download this
    @val = sort map {-M $_} grep {...
    
  3. or download this
    @tmp1 = readdir LOGS;  
         # @tmp now contains the files listed in "."
    ...
         #@tmp3 now contains what?
    
    @val = sort @tmp3;
    
  4. or download this
    use strict; #you are using strict, aren't you? ;)
    my @val = map   { $_->[0] } 
    ...
              map   { [$_, -M $_] }
              grep  { /\.log$/ }
              readdir LOGS;