in reply to Re^2: Need an $a and $b as in perl's sort routine
in thread Need an $a and $b as in perl's sort routine
No it wouldn't. Or rather $::row would revert to whatever it was before you localized it once you exited the sub that contains the localization. In the example below i use a bare block instead of sub to demonstrate but the same thing applies.
D:\dev\PM>perl -le"$::x='outer'; $c=sub{print $::x}; { local $::x='inn +er'; $c->() } $c->()" inner outer
Thats the whole point of dynamic scoping...
|
|---|