[Israel.pm] Moose question

Gaal Yahas gaal at forum2.org
Wed Apr 4 00:53:08 PDT 2012


use Moose::Util::TypeConstraints;

enum 'RGBColors', [qw(red green blue)];

(FWIW this is the first hit on https://www.google.com/search?q=moose+enum )


On Wed, Apr 4, 2012 at 9:27 AM, Dov Levenglick <dov.levenglick at gmail.com>wrote:

> Hi,
> I want to declare a 3 value'd enum equivalent - i.e. (mixing C and perl):
>
> package My::Enum
> use Moose;
>
> typedef enum {A, B, C} enum_t;            // knowledge in C - how do I
> port this concept to Perl?
> has 'b' => (isa => 'enum_t',  is => 'rw');
>
> 1;
>
>
> How would one go about doing that
>
>
> Best Regards,
> Dov Levenglick
> _______________________________________________
> Perl mailing list
> Perl at perl.org.il
> http://mail.perl.org.il/mailman/listinfo/perl
>



-- 
Gaal Yahas <gaal at forum2.org>
http://gaal.livejournal.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.perl.org.il/pipermail/perl/attachments/20120404/40356356/attachment.htm 


More information about the Perl mailing list