Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
comment on |
( [id://3333]=superdoc: 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 reply to Re (tilly) 1: Morse::Code
by tilly
|
|