Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Hash of Hash of Listed subroutines

by jdporter (Paladin)
on Jan 10, 2003 at 00:49 UTC ( [id://225701]=note: print w/replies, xml ) Need Help??


in reply to Hash of Hash of Listed subroutines

...I'm suspecting that there is a problem in the manner that I am calling the subroutine.
Yep. If you rename that $i variable to $subref, it will become apparent what you can do next.
The other thing to remember is that you can't embed a function call directly in a string. You can assign the result to a variable (scalar or array) and embed that; or you can pass multiple arguments to print(), as I do below.
for my $key ( %HoL ) { for my $subref ( @{ $HoL{$key} } ) { print "$key -> ", &{$subref}, "\n"; } }
(P.S. -- whitespace good. :-)

jdporter
The 6th Rule of Perl Club is -- There is no Rule #6.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (4)
As of 2024-04-25 20:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found