Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Stupid mistakes I repeatedly make

by tilly (Archbishop)
on Mar 27, 2005 at 16:10 UTC ( [id://442633]=note: print w/replies, xml ) Need Help??


in reply to Stupid mistakes I repeatedly make

I don't do most of yours. (The shift one I do, but not the others.) However a big favorite of mine is forgetting when I need to type $foo{bar} vs $foo->{bar}. But hey, that's what I use strict for, right?

Replies are listed 'Best First'.
Re^2: Stupid mistakes I repeatedly make
by jplindstrom (Monsignor) on Mar 27, 2005 at 18:23 UTC
    Is it not rather that you can't easily tell from context whether foo is a hash or a hashref?

    /J

      Is it not rather that you can't easily tell from context whether foo is a hash or a hashref?
      It's not paying attention to context. Last time I did that, I passed a reference to a named hash to a function, e.g., foo_function(\%hash), then in the function started using the argument as a hash instead of a hash reference, and inconsistently at that. And then going back to the calling function, and adding code that assumed the hash was a reference. TGFS (Thank Go(o?)d(ness)? for strict :)
        I am religious about avoiding having a hash and a hashref in scope with the same name. That way lies insanity and (a couple of refactorings later) hard to track down bugs.
      Oh I can tell.

      It is just that while coding, my fingers apparently can't (consistently at least).

      This may have something to do with the fact that I use hashrefs a lot like I use hashes. Or the fact that I don't care because strict catches it so quickly, so I don't pay close enough attention to get it right.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (3)
As of 2024-04-19 01:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found