package crmtest; use strict; use warnings; sub new { my ($class, $env) = @_; my @columns = ('one', 'two', 'three', 'four'); my $self = bless { 'env' => $env, 'column' => \@columns, # <-- Reference to an array given here }, $class; return $self; } sub add { my ($self, $fields) = @_; foreach my $field(@$self->{'column'}) { # <-- Not an ARRAY reference here print $field . " -- " . $self->{'column'} . "\n"; # do stuff... } } 1;