Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Here is the code:Warning: Use of "-s" without parentheses is ambiguous at test.pl line 19. Unterminated <> operator at test.pl line 19.
Thanks for the Help!#!usr/bin/perl use warnings; use strict; use Data::Dumper; use File::Slurp qw(read_dir); use File::Basename; my @files; my @directories = qw( dir/dir1 dir/dir2 ); my $min_size = 1024; #1K my $max_size = 10240; #10MB my $c; for my $d (@directories) { $c++; push @files , grep { -f && -s >= $min_size && -s <= $max_size "$d +/$_" } read_dir($d); } foreach my $file(@files) { print "\n$file\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Get file min and max size help!
by SuicideJunkie (Vicar) on Aug 29, 2011 at 14:24 UTC | |
|
Re: Get file min and max size help!
by jwkrahn (Abbot) on Aug 29, 2011 at 18:13 UTC | |
|
Re: Get file min and max size help!
by roboticus (Chancellor) on Aug 29, 2011 at 14:26 UTC | |
by Anonymous Monk on Aug 29, 2011 at 14:33 UTC | |
by roboticus (Chancellor) on Aug 29, 2011 at 19:00 UTC | |
by Corion (Patriarch) on Aug 29, 2011 at 19:05 UTC | |
|
Re: Get file min and max size help!
by blue_cowdawg (Monsignor) on Aug 29, 2011 at 14:24 UTC | |
|
Re: Get file min and max size help!
by Perlbotics (Archbishop) on Aug 29, 2011 at 14:36 UTC |