Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: kakuro puzzle generator

by pKai (Priest)
on May 22, 2006 at 12:05 UTC ( [id://550913]=note: print w/replies, xml ) Need Help??


in reply to kakuro puzzle generator

I violate the rules regarding global variable, strict and warnings.

Making it strict and warnings compliant was not very difficult and could be carried out in a quite mechanical way:

  • strict was satified after declaring 6 more sub-specific variables with my.
  • warnings were issued for using non-existant array/hash values. I silenced these by looking what kind of data is expected and making an appropriate || fallback, e.g. line 278 became:
    ($nl, $nd) = ( scalar(@{ ($tmp_across{$cur}||=[])->{locs} ||=[] }), scalar(@{ ($tmp_across{$cur}||=[])->{nums} ||=[] }) );
    this way

All in all not very demanding and nothing which should have caused much headache had your script been started with use strict; use warnings; as the first keystrokes right from the beginning of creating it.

As for the global variables... at least they already were cleanly declared, YMMV.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2024-04-25 23:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found