Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^3: Can't get rid of: Useless use of private variable in void context

by Anonymous Monk
on Feb 25, 2013 at 10:35 UTC ( [id://1020491]=note: print w/replies, xml ) Need Help??


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 }
  • Comment on Re^3: Can't get rid of: Useless use of private variable in void context
  • Download Code

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!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1020491]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (7)
As of 2024-04-23 11:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found