![]() |
|
Pathologically Eclectic Rubbish Lister | |
PerlMonks |
Re^3: Removing a string-element from an array of stringsby AnomalousMonk (Bishop) |
on Jul 26, 2020 at 17:58 UTC ( #11119833=note: print w/replies, xml ) | Need Help?? |
I found an example that works on an array with the form @array = ( "aaaa" , "bbbb" , "cccc" , "dddd" ), but it refuses to work for my @history array ( the parens in the string(s) ? ) Impossible to say. You've provided no code to examine. Here's something that may work IIUC your requirements: Note that this will remove and append all matching strings to the end of the array, not just the first one. See List::MoreUtils::part(). WRT this comment by LanX which I just saw, note that the solution above uses exact string comparison, not regex comparison. If you're using regexes, the approach must be slightly different. Give a man a fish: <%-{-{-{-<
In Section
Seekers of Perl Wisdom
|
|