Is it ever necessary to end a (perl) Moose class with 1;? -


i'm new moose, , moose manual on classes seems valid class is:

package person; use namespace::autoclean; use moose;  __package__->meta->make_immutable; 

but terminal "i'm returning true" 1; ???

i can find many example of moose classes do end 1; useless or necessary (and why)? since can find many examples of moose classes use strict; , use warnings;, redundant, seems old perl habits die hard.

no, $meta->make_immutable guaranteed return true value.

this method create immutable transformer , use make class , metaclass object immutable, and returns true (you should not rely on details of value apart truth).


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -