Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: using variables in late contexts?

by robartes (Priest)
on Nov 26, 2002 at 22:37 UTC ( [id://215955]=note: print w/replies, xml ) Need Help??


in reply to using variables in late contexts?

Your code should work, except that you need to replace:
%cmd_table{$test}
by
$cmd_table{$test}
You are refering to the value of a hash entry, not the hash itself, that's why you need $.

Oh, and there is no need for the @testarray (at least not in this snippet): just loop over the keys of %cmd_table, as in:

foreach $test (keys %cmd_hash) { # do your thing }
Hope this helps.

CU
Robartes-

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (5)
As of 2024-04-24 12:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found