aboutsummaryrefslogtreecommitdiff
path: root/samples/Perl/oo3.pl
blob: e86a1908c4ea3c58f628e1e0f2d9d2f7d4ab6b8a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#! perl

# Copyright (C) 2004-2006, Parrot Foundation.

use strict;
use warnings;

my $o = new Foo();
for my $i ( 1 .. 500000 ) {
    my $x = $o->[0];
    my $y = $o->[1];
}
print $o->[0], "\n";

package Foo;

sub new {
    my $self = ref $_[0] ? ref shift : shift;
    return bless [ 10, 20 ], $self;
}

1;

# Local Variables:
#   mode: cperl
#   cperl-indent-level: 4
#   fill-column: 100
# End:
# vim: expandtab shiftwidth=4: