Beefy Boxes and Bandwidth Generously Provided by pair Networks Bob
go ahead... be a heretic
 
PerlMonks  

Re^4: Repeating Code - there has GOT to be a better way!

by almut (Canon)
on Apr 01, 2010 at 07:01 UTC ( #832221=note: print w/ replies, xml ) Need Help??


in reply to Re^3: Repeating Code - there has GOT to be a better way!
in thread Repeating Code - there has GOT to be a better way!

Or even

#!/usr/bin/perl my %cmds = map { (/(.*)Cmd/) => { do $_ } } <*Cmd.pm>; use Data::Dumper; print Dumper \%cmds;
$ cat *Cmd.pm ; ./832111.pl %barCmd = ( # barCmd.pm BAR => 99, # ... ); %fooCmd = ( # fooCmd.pm FOO => 42, # ... ); $VAR1 = { 'bar' => { 'BAR' => 99 }, 'foo' => { 'FOO' => 42 } };


Comment on Re^4: Repeating Code - there has GOT to be a better way!
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (6)
As of 2014-04-19 03:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (477 votes), past polls