I have a class with several variables, one of which is a hash (_runs):
sub new
{
my ($class, $name) = @_;
my $self = {
_name => $name,
You are storing references to array or hashes in your object. To use them with standard functions you'll need to dereference them. For example:
@{ $self->{_array_ref_key} };
%{ $self->{_hash_ref_key} };
If you need pass parameters to standard function:
push( @{ $self->{_array_ref_key} }, $some_value );
for my $hash_key ( keys %{ $self->{_hash_ref_key} }) {
$self->{_hash_ref_key}{$hash_key}; ## you can access hash value by reference
}
Also $self->{_hash_ref_key}{$hash_key}
syntax is shortcut for $self->{_hash_ref_key}->{$hash_key}
(which can make for sense if you see it first time).
Also take a look at corresponding manual page.