#!/usr/bin/perl use strict; use warnings; package Widget::Select; use Moose; use Data::Dumper; has 'tuple' => (is => 'rw'); # ID, Text, ... has 'name' => (is => 'rw'); has 'selection' => (is => 'rw'); sub set_tuple { my $self = shift; $self->{tuple} = [@_] if @_ % 2 == 0; } sub as_form { my $self = shift; my @l = @{$self->{tuple}}; # non destructive my $o = '' . "\n"; return $o; } 1;