Perl: the Markov chain saw | |
PerlMonks |
Re (tilly) 1: Morse::Codeby tilly (Archbishop) |
on Apr 16, 2001 at 07:35 UTC ( [id://72760]=note: print w/replies, xml ) | Need Help?? |
On the BEGIN block issue. tye and I disagree quite
emphatically on that, see the discussion starting at
Re (tilly) 1: Supersplit for details. Suffice it to say that I would
drop that block, and move strict to after the initial
declarations. On a more important note, my does not do what vars does. Things like @ISA, @EXPORT_OK, etc need to be global, not lexical. Either move strict to after them, or else declare with vars. my simply will not work. Thirdly your method/no method code has a lot of repeated logic in it. I would recommend replacing it by something that looks like this: This also allows you to move the my declarations to the first use of the variables. Stylistically I prefer this for lexicals. For more of my philosophy on scoping see RE (tilly) 3: redeclaring variables with 'my'.
In Section
Cool Uses for Perl
|
|