- or download this
print scalar @var, "\n";
- or download this
#!/usr/bin/perl -w
...
my @arry = (0..100000);
return \@arry;
}
- or download this
Benchmark: timing 100 iterations of no ref, ref...
no ref: 33 wallclock secs (28.19 usr + 0.07 sys = 28.26 CPU) @ 3.54
+/s (n=100)
ref: 10 wallclock secs ( 9.21 usr + 0.34 sys = 9.55 CPU) @ 10.47
+/s (n=100)
- or download this
sub new {
my $class = shift;
my $self = {
...
my ($self) = @_;
return $self->{'list'};
}
- or download this
sub get_list {
my ($self) = @_;
my %ref = %{ $self->{'list'} };
return \%ref;
}