Hi everyone,
I'm new to perl and I keep getting the following error. Any idea how I can get rid of it?
"Global symbol "@state" requires explicit package name"
use threads::shared;
use strict;
use warnings;
my $tmp=meow();
my $state = &make_shared_array();
for (my $i=0 ; $i<2; $i++){
for (my $j=0; $j<6; $j++){
print "$state[$i][$j] \n";
}
}
my @array = ();
#for(my $i=0; $i<222; $i++){
for (my $j=0; $j<222; $j++){
$array[$j] = $state[1][$j];
}
if ($array[0] == $state[1][0]){
print " array[0] = $array[1] \n";
}
sub meow {
my $i = 0;
my $j = 1;
my @p = ("grey" , "striped" , "purrr", "cutest_kitty" , "meowing_kitty", "the_lord_of_the_cats");
my @k = ("smart_kitty" , "striped_sweety" , "purrr", "meowing_poes" , "social_kitty", "the_lord_of_the_poezen");
for (my $f=0; $f<6 ; $f++) {
push(@{$state[$i]}, $p[$f]);
push(@{$state[$j]}, $k[$f]);
}