in reply to Extremely weird module issue...

It's definitely a bug caused by the Switch module. You could file this as a bug on rt.cpan.org. Otherwise the solution is to not use Switch. It doesn't work, and there are other, more robust, ways of dealing with switches. Even if you get it to work now through some weird contorsions in your code, changes down the track will cause it to begin failing again.

On the other hand, with minor adjustments, your code works fine with bleadperl, which has a language-level switch keyword:

package F::Ast::Action; use strict; use warnings; use feature 'switch'; =over 4 =item constants =back =cut sub new { return bless [], shift; } sub doCmd { my $self = shift; my $cmd = shift; given ($cmd) { when ('get_permission') {} } } 1;

You just have to wait until 5.10 comes out :)

(gah! I had this in preview mode in another tab and forgot to hit submit for 5 hours. I hate when that happens).

• another intruder with the mooring in the heart of the Perl