in reply to Re: compiletime checking of valid method calls
in thread compiletime checking of valid method calls

Many thanks! :)

I have to admit that the fields pragma has always been one of the most obscure parts of Perl for me.

From the documentation it's supposed to only limit hash access. From the synopsis:

# this will generate a compile-time error my Foo $foo = Foo->new; $foo->{zap} = 24;

There is no mention of restricting methods, as far as I can see.

And the mainstream says that directly accessing attributes should be totally avoided and better be done via getter and setter methods. ( Well I know that this rule is mostly ignored in Python)

I have problems imagining what for the fields pragma was introduced

Edit

Oh I think I understand now what you are trying to do, limiting the hash access to the STASH of the class?

That's ... Courageous! :)

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery FootballPerl is like chess, only without the dice