Jan 24, 2014, 3:00 AM
Post #1 of 2
Extract elements from an array
@x = ("mickey", "Donald", "minnie", "Daisy", "Tralfaz");
I looped through some device configs isolated the hostname and pushed into an array. I want to define those names not conforming to "the naming standard". Anything starting with a capital letter is wrong. I want to extract only those elements from the array, maybe push into another array so that I can loop, do a lc(), and fix the device name.
So I guess my question is, is there a way to pull directly from @x or do I have to loop through @x and check each element with m/^[A-Z]/
as usual, thanks for the help.