Subject: | Named constructor |
It might be nice to be able to
named_struct RGB => [qw( red green blue )];
my $colour = RGB( red => 1, green => 0.4, blue => 0.1 );
Or somesuch.
Or maybe
struct RGB => [qw( red green blue )], named_constructor => 1;
Set a (per-package) default by
use Struct::Dumb qw( :named_constructors );
--
Paul Evans