Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: My habitual errors

by liverpole (Monsignor)
on Apr 15, 2007 at 15:13 UTC ( [id://610200]=note: print w/replies, xml ) Need Help??


in reply to My habitual errors

Hi moron,

That's a very entertaining question!  The reason it took me a while to answer is was that I couldn't remember the overriding mistake that I make, out of the many that I make all the time.  I knew there was something, but I just couldn't put my finger on it.

Then I remembered ... the hands-down winner for me is putting semi-colons after values in a declared hash, instead of commas.

That is, I like to write long data structures in this format:

my $p_employee = { 'alice' => { 'salary' => 75000, 'hired' => 1176649545, 'manager' => 'bob', }, 'bob' => { 'salary' => 82000, 'hired' => 1145113545, 'manager' => 'carol', }, 'carol' => { 'salary' => 96000, 'hired' => 1145113545, 'manager' => 'thomas', }, };

But invariably I end up putting semi-colons at the end of one or more lines -- for example:

my $p_employee = { 'alice' => { 'salary' => 75000, 'hired' => 1176649545, 'manager' => 'bob', }; 'bob' => { 'salary' => 82000, 'hired' => 1145113545, 'manager' => 'carol', }; 'carol' => { 'salary' => 96000, 'hired' => 1145113545, 'manager' => 'thomas', }, };

It also seems to happen with a frequency in direct proportion to the complexity of the data structure.  I'm pretty sure this has bitten me more than any other single class of error.


s''(q.S:$/9=(T1';s;(..)(..);$..=substr+crypt($1,$2),2,3;eg;print$..$/

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2024-04-23 21:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found