in reply to Duplicate variable returned from sub
It’s easy enough to test–
perl -Mstrict -wE 'my ( $v1, $v2, $v1 ) = ( 1 .. 3 ); say $v1' "my" variable $v1 masks earlier declaration in same statement at -e li +ne 1. 3
I would not rely on the behavior though. Definitely fix it by cutting out the duplicates.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Duplicate variable returned from sub
by Zenzizenzizenzic (Pilgrim) on Sep 23, 2019 at 17:05 UTC | |
by Perlbotics (Archbishop) on Sep 23, 2019 at 17:12 UTC | |
by Zenzizenzizenzic (Pilgrim) on Sep 23, 2019 at 17:17 UTC | |
by AnomalousMonk (Archbishop) on Sep 23, 2019 at 22:07 UTC |