johnirl has asked for the wisdom of the Perl Monks concerning the following question:
So when my program asks what are the values for "l" (switch names decided at run time so it could be anything not just "l", "d"or "m") it should recieve an array containing ("load1", "load2", "load3", "load4").@switches = ("-d", "-l", "-m"); @values = ("-d", "disk1", "disk2", "disk3", "-l", "load1", "load2", "l +oad3", "load4", "-m" "memory1", "memory2");
I know it has something to do with hashes (probably) but my experience with them is limited.
What would be the best way to implement this?
Thanks in advance
j o h n i r l .
Sum day soon I'Il lern how 2 spelI (nad tYpe)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Creating a Hash from Two Arrays
by Abigail-II (Bishop) on Sep 18, 2002 at 17:15 UTC | |
|
Re: Creating a Hash from Two Arrays
by zigdon (Deacon) on Sep 18, 2002 at 17:08 UTC | |
by Aristotle (Chancellor) on Sep 18, 2002 at 19:55 UTC | |
|
Re: Creating a Hash from Two Arrays
by fglock (Vicar) on Sep 18, 2002 at 17:05 UTC | |
|
Re: Creating a Hash from Two Arrays
by talexb (Chancellor) on Sep 18, 2002 at 17:12 UTC | |
|
Re: Creating a Hash from Two Arrays
by jmcnamara (Monsignor) on Sep 18, 2002 at 17:14 UTC |