in reply to Testing if variable is threads::shared ?
It returns a true value (a memory address) if $var is shared, and undef if not.use threads; use threads::shared; my $var : shared; if (threads::shared::_id($var)) { print("'\$var' is shared\n"); }
NOTE: This is not documented, and the underscore in the name indicates its internal use nature. This function is found in ext/threads/shared/shared.xs in the Perl source code distribution.
UPDATE: Corrected as per below. Thanks pg.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Testing if variable is threads::shared ?
by pg (Canon) on Aug 30, 2005 at 19:21 UTC | |
|
Re^2: Testing if variable is threads::shared ?
by renodino (Curate) on Aug 30, 2005 at 20:49 UTC | |
by jdhedden (Deacon) on Aug 31, 2005 at 00:32 UTC |