in reply to Morse::Code
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.my $self = ref($_[0]) ? shift : $default_self;
For more of my philosophy on scoping see RE (tilly) 3: redeclaring variables with 'my'.
|
---|