File: TODO

package info (click to toggle)
libfile-finder-perl 1.01-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 160 kB
  • sloc: perl: 993; sh: 3; makefile: 2
file content (30 lines) | stat: -rw-r--r-- 748 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
## -*- cperl -*-

## update _run from the article (which did it better)

## and vice versa... reference the article from the See Also

use File::Finder qw(contains foo bar);
# pulls in File::Finder::Plugin::contains etc

## oval: like eval, but operates on open file handle
## (like a more general "contains")

## from ovid:
my %status = (
	      links => sub { (stat(_))[3] },
	      inum => sub { (stat(_))[1] },
	      atime => sub { int(-A _) },
	      mtime => sub { int(-M _) },
	      ctime => sub { int(-C _) },
	     );
while (my ($function,$op) = each %status) {
  no strict 'refs';
  *$function = sub {
    my $self = shift;
    my ($prefix, $n) = shift =~ qr/^(\+|-|)(.*)/;
    return sub {
      _n($prefix, $n, $op->());
    };
  }
}