good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
What's happening is that map is giving you the result of what happens inside the parentheses, not the final value of $_. The regex matches once each time, so the result is 1 each time. I'm not a frequent map user, but try this (untested) instead:
I think that'll work, assuming you want your command line arguments in @array whether they have leading hyphens or not, but, even if it does work, it's lousy code. Surely there's a better way, but I'm too tired to see it. They laughed at Joan of Arc, but she went right ahead and built it. --Gracie Allen In reply to Re: Map not giving me what I thought it would.
by adamsj
|
|