Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
This code is taken from a subroutine. It is returning a reference to a function (called a coderef I think). The variable total_size is being used to keep a running total of the size of a collection of files. I don't understand this bitreturn sub {$total_size += -s if -f};
What is -s and how can increment total_size by it? What is -f. They look like they may be file flags but there isn't a file anywhere in sight! Many thanks$total_size += -s if -f
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: beginner - if test on file flags
by kennethk (Abbot) on Oct 15, 2010 at 15:25 UTC | |
by morgon (Priest) on Oct 15, 2010 at 15:48 UTC | |
by cdarke (Prior) on Oct 15, 2010 at 16:59 UTC | |
by locked_user sundialsvc4 (Abbot) on Oct 15, 2010 at 17:00 UTC | |
by Anonymous Monk on Oct 15, 2010 at 23:00 UTC |