Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^2: Help needed with Perl script designed to find files by extension and count the number of chars

by Anonymous Monk
on Apr 30, 2015 at 18:32 UTC ( [id://1125306]=note: print w/replies, xml ) Need Help??


in reply to Re: Help needed with Perl script designed to find files by extension and count the number of chars
in thread Help needed with Perl script designed to find files by extension and count the number of chars

The memory efficient version

#!/usr/bin/perl -- use strict; use warnings; use File::Find::Rule qw/ find rule /; my $count = 0; my $size = 0; rule( file => name => [ map {"*$_"} @ARGV ], exec => sub { ## my( $shortname, $path, $fullname ) = @_; $size += -s _; ## or use $_ $count++; return !!0; ## means discard filename }, )->in('.');
  • Comment on Re^2: Help needed with Perl script designed to find files by extension and count the number of chars
  • Download Code

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (2)
As of 2024-04-25 20:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found