in reply to Repeating Code - there has GOT to be a better way!

and each file contains a hash called <name>Cmd.

So you either need symbolic references, or (preferred) a hash containing references to all these hashes, and then simply loop over <name> and look into that hash.

Perl 6 - links to (nearly) everything that is Perl 6.

Replies are listed 'Best First'.
Re^2: Repeating Code - there has GOT to be a better way!
by jedikaiti (Hermit) on Mar 31, 2010 at 17:34 UTC

    Is this going to require Perl 6? I ask because I'm on 5.10.1.

    Kaiti
    Swiss Army Nerd
      Nope, works fine with Perl 5, and has nothing to do with my signature :-)
      Perl 6 - links to (nearly) everything that is Perl 6.

        Ahh, I did not realize that was part of your sig. :-)

        Thanks!

        Kaiti
        Swiss Army Nerd