Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^3: PERL issues a "lock can only be used on shared values" when locking a shared hash

by Anonymous Monk
on Apr 26, 2013 at 03:58 UTC ( #1030757=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
        my %hash :shared;
        $hash{'foo'} = 'bar';
        #lock($hash{'foo'}); # Error
        lock(%hash); # Works
    
  2. or download this
        my %hash :shared;
        my $ref = \%hash;
        lock($ref); # This is equivalent to lock(%hash)
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1030757]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (8)
As of 2014-12-17 23:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (40 votes), past polls