Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^3: How can i debug compound map/grep statements just using print?

by Kenosis (Priest)
on Dec 01, 2012 at 21:39 UTC ( #1006645=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    =item B<-a, --amount>
    
    Search for files older than <amount> days, mandatory.
    
  2. or download this
    $amount = $amount * 24 * 60 * 60;
    
  3. or download this
    $result =
      grep { /.+\.$suffix$/ and $time - ( $_->stat )[9] >= $amount }
      io($dir)->all;
    
  4. or download this
    $result = File::Find::Rule->file()
                              ->maxdepth(1)
                              ->name(qr/.+\.$suffix$/i)
                              ->mtime(">= $amount")
                              ->in($dir);
    
  5. or download this
    $result = grep { -M >= $amount / 86400 } # Convert back to days
              File::Find::Rule->file()
                              ->maxdepth(1)
                              ->name(qr/.+\.$suffix$/i)
                              ->in($dir);
    
  6. or download this
        $result =
          grep { $_ == 1 }
    ...
          map  { ( $_->stat )[9] }  # e.g i'm interested in this...
          grep { $_->name =~ /.+\.$suffix$/ } # ...and this
          io($dir)->all;
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1006645]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (6)
As of 2014-07-13 14:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (250 votes), past polls