in reply to Re: beginner - if test on file flags
in thread beginner - if test on file flags

I have a related question: Is

$total_size += -s _ if -f
(a little bit) more efficient (at least on Linux) then
$total_size += -s if -f
because it only calls stat once or is there no difference?

Replies are listed 'Best First'.
Re^3: beginner - if test on file flags
by cdarke (Prior) on Oct 15, 2010 at 16:59 UTC
    Slightly less efficent, so we could use _ instead:
    $total_size += -s _ if -f
Re^3: beginner - if test on file flags
by locked_user sundialsvc4 (Abbot) on Oct 15, 2010 at 17:00 UTC

    That is a matter for The Perl Implementors (and The Linux Implementors) to deal with.

    The Implementors Are Wise... wise beyond mortal understanding.

    “Be not concerned unnecessarily with efficiency,” he counseled, “for, verily, such concerns often produce something that is much more inefficient.”