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]);
}

In reply to Global symbol requires explicit package name by bebe

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.