KevinZwack has asked for the wisdom of the Perl Monks concerning the following question:
I've been able to create thread shared hashes of hashes and so forth... but the syntax to create a hash of anonymous arrays has me stumped. Getting this little snippet of code to work would be helpful. In fact, any help would be greatly appreciated.
Thanks,
Kevin Zwack
#!/usr/bin/perl5.8.8 -w use Data::Dumper; use threads; use threads::shared; my ($i, $j, $k) = (1, 2, 3); my %foo :shared; $foo{'bar'} = &share([]); #<-- Not what it wants $foo{'bar'} = [$i, $j, $k]; print Data::Dumper->new([\%foo],[qw(foo)])->Indent(4)->Quotekeys(1)->S +ortkeys(1)->Dump; exit;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Shared hash of anonymous arrays?
by BrowserUk (Patriarch) on Aug 29, 2006 at 22:21 UTC | |
by KevinZwack (Chaplain) on Aug 29, 2006 at 22:43 UTC | |
Re: Shared hash of anonymous arrays?
by GrandFather (Saint) on Aug 29, 2006 at 22:04 UTC | |
Re: Shared hash of anonymous arrays?
by mreece (Friar) on Aug 29, 2006 at 22:17 UTC |
Back to
Seekers of Perl Wisdom