Anonymous user
Compound data type: Difference between revisions
Added to the perl section
m (Fixed lang tags.) |
(Added to the perl section) |
||
Line 466:
=={{header|Perl}}==
{{works with|Perl|5.x}}
===Built-in Hash===
This is a hash (associative array), but accomplishes the task.
<lang perl>my %point = (
Line 471 ⟶ 472:
y => 8
);</lang>
===Built-in Array===
<lang perl>my $point = [3, 8];</lang>
===Class===
<lang perl>package Point;
use strict;
use base 'Class::Struct'
x => '$',
y => '$',
;
1;
my $point = Point->new(x => 3, y => 8);</lang>
=={{header|PHP}}==
|