in reply to Looking for small csv files script question

Just add -s:
push @files, $File::Find::name if -f && /\.csv/ && -s < 5500;
لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

Replies are listed 'Best First'.
Re^2: Looking for small csv files script question
by PerlPlay (Novice) on Dec 04, 2013 at 00:26 UTC

    Thanks I'll give that a go.

    I thought this might do the trick (It's doing something at least).

    sub csvfile { if ((stat($File::Find::name))[7] <= 5500) { push @files, $File::Find::name if -f && /\.csv/; } }

      Tried your example and it comes up with this.

      Warning: Use of "-s" without parentheses is ambiguous at csvfile.pl line 21. syntax error at csvfile.pl line 21, near "/\.csv/ -s " Unterminated <> operator at csvfile.pl line 21.

        Look at the error:

        ... near "/\.csv/ -s " ...

        You're missing the "&&" between "/\.csv/" and "-s".

        -- Ken