in reply to Re: How am i doing?
in thread How am i doing?

You call count but don't do anything with the return value

It's printed at the end.

Replies are listed 'Best First'.
Re^3: How am i doing?
by Fletch (Bishop) on Jul 17, 2025 at 15:19 UTC

    The last value assigned to the (lexically declared file) global $result is printed. Nothing is done with the (implicit) return value from the sub count where it's called.</nitpick>

    But yes eventually it's used. I was writing these in order as I read along so I didn't notice that action-at-a-distance because I glossed over the declaration on first read. Personal habit/preference is for a functional style (or OOP-y setters/getters at the worst :) and void context just looks plain wrong.

    The cake is a lie.
    The cake is a lie.
    The cake is a lie.