IraTarball has asked for the wisdom of the Perl Monks concerning the following question:
I have a script that is meant to manage a number of other executables and I am trying to get an array of the arguments. So a command like:
should end up with an args array equivalent togetStuff configs --force=all --out out.txt -v -a
I can do it with a split /(-+)/ and for ($i = 0; $i < $#args; $i++) type of thing. I look for -- and piece the pairs back together. But who wants to do that? Not only do I suspect there's another way to do it, I'll bet there's a better way to do it.@args = ( "configs", "--force=all", "--out out.txt", "-v", "-a");
Thanks for your help! Ira
"So... What do all these little arrows mean?"
~unknown
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: join this
by btrott (Parson) on May 26, 2001 at 07:39 UTC | |
|
Re: join this
by myocom (Deacon) on May 26, 2001 at 05:22 UTC | |
|
Re: join this
by TStanley (Canon) on May 26, 2001 at 05:24 UTC | |
by IraTarball (Monk) on May 26, 2001 at 05:36 UTC | |
by Coyote (Deacon) on May 26, 2001 at 07:48 UTC | |
|
Re: join this
by converter (Priest) on May 26, 2001 at 18:31 UTC | |
|
Re: join this
by IraTarball (Monk) on May 30, 2001 at 01:32 UTC |