http://www.perlmonks.org?node_id=1020491


in reply to Re^2: Can't get rid of: Useless use of private variable in void context
in thread Can't get rid of: Useless use of private variable in void context

sadly I still got to use perl 5.10 so local *HTEC... is not working

Sure it is, it worked since the very first perl5, at least

perl -MData::Dump -e" dd $f={2,{4,{6,8}}}; local *H=$$f{2}{4}; dd\%H" { 2 => { 4 => { 6 => 8 } } } { 6 => 8 }

Replies are listed 'Best First'.
Re^4: Can't get rid of: Useless use of private variable in void context
by tobias_hofer (Friar) on Feb 25, 2013 at 11:28 UTC
    Hey, you are right! :-)
    Perfect!

    But there is one thing, I have to remove the  use strict;
    else I get a:
    Global symbol "%HTEC" requires explicit package name at...

    Thanks a lot!
    Tobias

      There may be some case where removing "use strict; is a valid approach, but if so, I'm having a hard time thinking of it (not that I tried very hard -- because strict is your friend). Put it back in and find out how to make the hash "legal" (perhaps by declaring it with "my").


      If you didn't program your executable by toggling in binary, it wasn't really programming!