in reply to Re: threads and leaking scalars (Scalars leaked: 1)
in thread threads and leaking scalars
So, my recommendation is to *not* use @_ in the same scope as you launch new threads.
shift (in a sub) and shift(@_) result in exactly the same code, so you are still using @_.
>perl -MO=Concise,x -e"sub x { shift } main::x: 5 <1> leavesub[1 ref] K/REFC,1 ->(end) - <@> lineseq KP ->5 1 <;> nextstate(main 1 -e:1) v ->2 4 <1> shift sK/1 ->5 3 <1> rv2av[t2] sKRM/1 ->4 2 <#> gv[*_] s ->3 -e syntax OK >perl -MO=Concise,x -e"sub x { shift(@_) } main::x: 5 <1> leavesub[1 ref] K/REFC,1 ->(end) - <@> lineseq KP ->5 1 <;> nextstate(main 1 -e:1) v ->2 4 <1> shift sK/1 ->5 3 <1> rv2av[t2] lKRM/1 ->4 2 <#> gv[*_] s ->3
|
|---|