| … | |
… | |
| 50 | # |
50 | # |
| 51 | # Recursively handle the rows, but only enclose in brackets |
51 | # Recursively handle the rows, but only enclose in brackets |
| 52 | # to form reference to array of (references to arrays of ...) entries |
52 | # to form reference to array of (references to arrays of ...) entries |
| 53 | # |
53 | # |
| 54 | sub perl { |
54 | sub perl { |
| 55 | my $self = shift; my $context = $self->context; |
|
|
| 56 | my $parens = shift; my $matrix = shift; |
55 | my $self = shift; my $parens = shift; my $matrix = shift; |
| 57 | my $perl; my @p = (); |
56 | my $perl; my @p = (); |
| 58 | foreach my $x (@{$self->{coords}}) {push(@p,$x->perl(0,1))} |
57 | foreach my $x (@{$self->{coords}}) {push(@p,$x->perl(0,1))} |
| 59 | if ($matrix) { |
58 | if ($matrix) { |
| 60 | $perl = '['.join(',',@p).']'; |
59 | $perl = '['.join(',',@p).']'; |
| 61 | } else { |
60 | } else { |
| 62 | $perl = Value->Package($self->type,$context).'->new('.join(',',@p).')'; |
61 | $perl = $self->Package($self->type).'->new('.join(',',@p).')'; |
| 63 | $perl = '('.$perl.')' if $parens; |
62 | $perl = '('.$perl.')' if $parens; |
| 64 | } |
63 | } |
| 65 | return $perl; |
64 | return $perl; |
| 66 | } |
65 | } |
| 67 | |
66 | |