Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

File test in grep not excluding current directory

by GotToBTru (Prior)
on Jul 01, 2014 at 13:22 UTC ( [id://1091839]=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use strict;
    use warnings;
    ...
    find({preprocess => sub { return grep { -M $_ < 1 } @_ },
            wanted => sub { printf "%s\n",$_ if (-f $_) }
        }, $dir);
    
  2. or download this
    file1
    file2
    file3
    
  3. or download this
    use strict;
    use warnings;
    ...
    find({preprocess => sub { return grep { -f $_ && -M $_ < 1 } @_ },
            wanted => sub { printf "%s\n",$_ }
        }, $dir);
    
  4. or download this
    .
    file1
    file2
    file3
    
  5. or download this
    use strict;
    use warnings;
    ...
    find({preprocess => sub { printf "p %d %s\n",$p++,$_; return @_ },
            wanted => sub { printf "w %d %s\n",$p++,$_ }
        }, $dir);
    
  6. or download this
    ls -e /home/edi/wlsedi/howard/temp
    total 0
    ...
    -rw-r--r---    1 wlsedi   wlsedi            0 Jul 01 08:14 file1
    -rw-r--r---    1 wlsedi   wlsedi            0 Jul 01 08:14 file2
    -rw-r--r---    1 wlsedi   wlsedi            0 Jul 01 08:14 file3
    
  7. or download this
    w 0 .
    p 1 .
    ...
    w 4 file3
    w 5 dirhere
    p 6 dirhere
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1091839]
Approved by toolic
Front-paged by perlfan
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (4)
As of 2024-04-19 04:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found