|Perl: the Markov chain saw|
creating a subroutine for accessing hash of arraysby jonnyfolk (Vicar)
|on Mar 27, 2004 at 06:23 UTC||Need Help??|
jonnyfolk has asked for the
wisdom of the Perl Monks concerning the following question:
I have several statements accessing a hash of arrays, eg:
These are identical apart from the action that takes place within, and so I would like to create a subroutine containing a variable representing the action, which I can define before calling the subroutine.
Could anyone advise me how I could do this?Update: I noticed that the actions in both examples were very similar so I changed the second to a comment to avoid confusion...