Fun Perl Code Snippets

I collect some useful code snippets here for later usage or just keep a note of what I have read.

1.find files larger than a specifed size(in byte):

use File::Find;
find(sub { print "$_\n" if -s $_ > $ARGV[0]; }, ".");

2.we can use “man module::name” or “perldoc module::name” to check the detailed info of a module.

3.For the first example, if using require, we can write it as the following:

require File::Find;
File::Find::find(sub { print "$File::Find::name\n" if -s > 1_024_000; }, '.');

4.”use” happens during compile time, whereas “require” happens at runtime.