in reply to Re: Testing if variable is threads::shared ?
in thread Testing if variable is threads::shared ?

The posted code returned:

Undefined subroutine &threads::shared::_id called at math1.pl line 5.

Testing is done with 5.8.4 on windows XP.

Update: The above code could be fixed like this:

use threads; #added use threads::shared; my $var : shared; if (threads::shared::_id($var)) {#pass the var not the ref print("'\$var' is shared\n"); }