Thread Tupel in Perl (29 answers)
Opened by flixxflaxx at 2013-07-20 14:10

renee
 2013-07-25 00:00
#169113 #169113
User since
2003-08-04
14371 Artikel
ModeratorIn
[Homepage] [default_avatar]
Wenn Du die Dereferenzierung "verstecken" willst:

Code (perl): (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
{
  package Container;
  use Moose;
  has e_00_00 => ( is => 'ro', isa => 'ArrayRef[Int]', default => sub { [1,2] }, auto_deref => 1 );
  has e_00_01 => ( is => 'ro', isa => 'ArrayRef[Int]', default => sub { [3,4] }, auto_deref => 1 );
  has e_01_00 => ( is => 'ro', isa => 'ArrayRef[Int]', default => sub { [5,6] }, auto_deref => 1 );
  has e_01_01 => ( is => 'ro', isa => 'ArrayRef[Int]', default => sub { [7,8] }, auto_deref => 1 );
  has e_02_00 => ( is => 'ro', isa => 'ArrayRef[Int]', default => sub { [9,10] }, auto_deref => 1 );
  has e_02_01 => ( is => 'ro', isa => 'ArrayRef[Int]', default => sub { [11,12] }, auto_deref => 1 );
}

my $c = Container->new;
print +($c->e_02_00)[0];
OTRS-Erweiterungen (http://feature-addons.de/)
Frankfurt Perlmongers (http://frankfurt.pm/)
--

Unterlagen OTRS-Workshop 2012: http://otrs.perl-services.de/workshop.html
Perl-Entwicklung: http://perl-services.de/

View full thread Tupel in Perl