- or download this
{
my $x = 20;
...
--output:--
20 #…yet the sub can still see $x
- or download this
use threads;
use threads::shared;
...
--output:--
20
- or download this
use threads;
use threads::shared;
...
--output:--
<blank line> #but the thread can't see $x