in reply to Reaped: perl challenge 3

Monks... Please see Re: perl challenge 2

Replies are listed 'Best First'.
Re^2: perl challenge 3
by FreeBeerReekingMonk (Deacon) on Dec 16, 2015 at 00:42 UTC

    awww... and here I had this nice Perl script:

    use warnings; use strict; print `find . -type f -size +500k`

      #!/usr/bin/perl use File::Find::Rule; use warnings; my $filelist; sub buildFile { open ($filelist, ">", "filelist.txt") || die $!; # File find rule and # Provide specific list of directories to scan my $SubDirs= File::Find::Rule->directory->in('etc', 'dev', 'bin'); + # interpret Size Method and stored the list on @files my @files = File::Find::Rule->size('500')->in($SubDirs); print $filelist map { "$_\n" } @files; return \$filelist; }

      this is what i had can someone correct me

        Query Method in( @directories )
        so ->in($SubDirs); has to be an array, and not a scalar string.

        Hint: qw(/etc /dev /bin) creates a nice array with those directories.

        Please notice the slash at the beginning. A directory always has that...



        perl -MFile::Find::Rule -e 'print join("\n", File::Find::Rule->directory->in(qw(/etc /dev /bin)));'

        this is what i had can someone correct me

        Does it need correcting?

      LOL... I just had beer come out my nose. Is that called irony? ;)

        It IS... I just was done cleaning the monastery gates... I'll get a mob.