Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Lady_Aleena's scratchpad

by Lady_Aleena (Deacon)
on Sep 07, 2007 at 20:54 UTC ( #637756=scratchpad: print w/ replies, xml ) Need Help??

old code

my $table_name = "$name\'s THAC0"; my $table_id = idify($table_name); table( $opt{'tab'}, { 'id' => $table_id, 'class' => 'player_characte +r THAC0', 'caption' => $table_name, 'rows' => \@rows } ); my $table_name = "$name\'s<br/> armor class"; my $table_id = idify($table_name); table( $opt{'tab'}, { 'id' => $table_id, 'class' => 'player_characte +r armor_class', 'caption' => $table_name, 'rows' => \@rows } ); my $table_name = "$name\'s<br/> saving throws"; my $table_id = idify($table_name); table( $opt{'tab'}, { 'id' => $table_id, 'class' => 'player_characte +r saving_throws', 'caption' => $table_name, 'rows' => \@rows } ); my $table_name = "$name\'s<br/> $class skills"; my $table_id = idify($table_name); table( $opt{'tab'}, { 'id' => $table_id, 'class' => 'player_characte +r rogue_skills', 'caption' => $table_name, 'rows' => \@rows } ); my $table_name = "$name\'s<br/> spell progression"; my $table_id = idify($table_name); table( $opt{'tab'}, { 'id' => $table_id, 'class' => 'player_characte +r spell_progression', 'caption' => $table_name, 'rows' => \@rows }); my $table_name = "$name\'s<br/> psionics"; my $table_id = idify($table_name); table($tab, { 'id' => $table_id, 'class' => 'player_character psioni +cs', 'caption' => $table_name, 'rows' => \@rows });


my $noon = 12:00; my %dayparts = ( 'morning' => { 'begin' => $dawn, 'end' => $noon}, 'afternoon' => {'begin' => $noon, 'end' => $dusk - 1}, 'evening' => { 'begin' => $dusk - 1, 'end' => $dusk + 1}, 'night' => { 'begin' => $dusk + 1, 'end' => $dawn} );

Notes to self

  • Do not print Dumper when trying to display a script in a browser without using <pre> tags.
  • Do print Dumper when something goes wrong. The data structure is usually the problem.
  • If one changes a variable, check the whole script for that variable to make sure that the results will be as expected.
  • rename will not create directories, be sure to use mkdir in conjunction with rename if the files are also being moved to a new directory.

Notes from others

  • bart: LA it's often considered good practice to increment the variable in a continue block, to prevent running out of sync when using next.
  • Intrepid: btw, i wish i could explain to a lot of people i know, how efficacious Lady_Aleena's explained strategy can be (to use coding and thinking about coding to master a disquieted state of mind)
  • ambrus: In general, use magic only when normal solutions aren't enough.
  • GrandFather: each time through its loop while asks itself "Can I loop this time? Can I? Can I Can I? Please?" and if the answer is no (false statement) while gets grumpy and stops
  • GrandFather: First make it work (using the easiest to maintain code you can) then, only if you need to, make it faster. (from: Re^5: I have a list expanding when I don't want it to)

Things I should get a grip on

  • objects
  • SQL
  • version control
  • testing
Log In?

What's my password?
Create A New User
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (7)
As of 2014-12-28 07:08 GMT
Find Nodes?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?

    Results (179 votes), past polls