There probably is some F::F::R extension that looks into files that could eliminate my greps and readfiles completely.
Yep, and it's waiting right there in the
File::Find::Rule POD..
:) I know you said it's throwaway, but for the heck of it (untested):
#!/usr/bin/perl -w
use strict;
use File::Find::Rule;
my %uid;
my %vm_data;
print("Killing $_\n"), kill 15, $_
for map /(\d+)/,
File::Find::Rule
->file
->name('status')
->grep(sub {
my $fullname = $_[2];
$uid{$fullname}++ if /^Uid:\s*33\b/;
$vm_data{$fullname}++ if /^VmData:\s*(\d+)/ and $1 > 16384
+;
return $uid{$fullname} and $vm_data{$fullname};
})
->in('/proc');
What can I say?
File::Find::Rule rocks.
:)
Makeshifts last the longest.