Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Tie::File, is untie file handle must?

by u65 (Chaplain)
on Aug 04, 2015 at 13:29 UTC ( [id://1137375]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1137375]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (4)
As of 2024-04-18 20:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found