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
Post a Comment