I am trying to write a function that returns an array reference of 'mat::Network' objects. But the returned array doesnt seem to be what im expecting. The error seems to be thinking im trying to call something on 'Main' not 'mat::Network'
Example:
my $aa=x();
foreach(@$aa){
$_.p();
}
sub x {
my @ret;
my $a=mat::Network->new({name=>'test'});
my $b=mat::Network->new({name=>'test2'});
push(@ret,$a);
push(@ret,$b);
return(\@ret);
}