http://qs321.pair.com?node_id=391388


in reply to hash name as a variable?

Don't EVER put a variable name in a variable.

I created hash tables for each of these instances and then hit a snag. Instead of duplicating the code for each hash table I thought I would just have the one piece of code with the relevant hash table name as a variable.

Have a single subroutine which takes a reference to the appropriate hash as one of its parameters.

Incidentally, you really should reduce the code needed to demonstrate your problem to the bare minimum. You posted too much code, and I don't have the patience to read it.

Replies are listed 'Best First'.
Constructive Criticism (was: hash name as a variable)
by Rhys (Pilgrim) on Sep 16, 2004 at 14:05 UTC
    Incidentally, you really should reduce the code needed to demonstrate your problem to the bare minimum. You posted too much code, and I don't have the patience to read it.

    In that case, rather than complaining, we could teach the OP about <readmore> tags.

    When posting long messages - particularly those containing large chunks of code - it's often wise to enclose the 'long part' like this:

    <readmore> # long part </readmore>

    That way, a link is automatically created so we only have to see the enclosed text if we need to. This keeps the visible post much shorter and easier to digest. This and other useful info is available at Writeup Formatting Tips.

    Hope that helps!

    --J

    Update: Changed node title to better reflect content.

    Update 2: Changed node title again to 'link' to original thread.

      All "read more" would have done is hide some of the code. It wouldn't have cut the code down to the bare essentials which would have illustrated the OP's problem.