Perl-Sensitive Sunglasses | |
PerlMonks |
sharing array of arrays between threadsby bebe (Novice) |
on Aug 10, 2012 at 04:51 UTC ( [id://986658]=perlquestion: print w/replies, xml ) | Need Help?? |
bebe has asked for the wisdom of the Perl Monks concerning the following question: Hi I'm trying to share an array of arrays between threads and I have no luck with that. I'm new to Perl, I would really appreciate all your help here is how I'm sharing array X
my $ARRAY_SIZE = 45; my $X = &make_shared_array();
sub make_shared_array {
Basically, new string in (Var2) will be pushed into array X every time this sub gets called. After we are done writing array X, I would like to be able to compare each of these arays X[0], X[1], X[2], .... Against a one_dim array "Y" but before I even get to compare the arrays I tried to print X[1] and it's blank :( I'm not sure what I'm missing. Thank you so so much for your help
sub test{ Print "@X[1]\n"; } This is what I'm hoping to print:
X[0] = ("QWE", "RTYU" ,"IOP") X[1] = ("QSWE", "TYU" ,"IKOP", "BVC") X[2] = ("QE", "TYU") X[3] = ("QSWE", "TYU" ,"IKOP", "BVC", "LMNB") . . .
Back to
Seekers of Perl Wisdom
|
|