in reply to Tie::File, is untie file handle must?

And a nit pick: the bare

my $retries;

bothers me. I prefer always setting the initial state of such variables:

my $retries = 0;

Replies are listed 'Best First'.
Re^2: Tie::File, is untie file handle must?
by 1nickt (Canon) on Aug 04, 2015 at 15:25 UTC

    Curious about this. Why?

    The way forward always starts with a minimal test.

      Because its value is undefined.

      Update: And I don't that's good practice when we're going to change its value with an increment operation in a following loop.

        Because its value is undefined.

        Personally, I think that's a good thing.

        That way, if I try to use it -- like print it -- before I've done something sensible with it, I get a nice friendly message telling me so; rather than an mysterious zero that shouldn't be.

        If only C had a non-zero, non-null value that variables got implicitly initialised to.


        Anyone got any experience of this phone's predecessor?

        With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        "Science is about questioning the status quo. Questioning authority". I knew I was on the right track :)
        In the absence of evidence, opinion is indistinguishable from prejudice.
        I'm with torvalds on this Agile (and TDD) debunked I told'em LLVM was the way to go. But did they listen!

        what makes it better to change that value from zero than from undefined?

        The way forward always starts with a minimal test.