![]() |
|
"be consistent" | |
PerlMonks |
Re: Selecting the difference between two stringsby hgolden (Pilgrim) |
on Sep 26, 2006 at 21:06 UTC ( [id://575023]=note: print w/replies, xml ) | Need Help?? |
Hey I'm sure that someone will come up with a better way of doing this, but my first thought is to split those strings by "/" into arrays, and then use List::Compare to find the intersections, which you can then easily remove. Hays Update: Or much better, split then use Algorithim::Diff. Update question inspired by the response below: Are the comparisons just pairwise, or are you doing many at a time? The array solution above works for an arbitrary number, but if the comparisons are just two at a time, the below code is much slicker.
In Section
Seekers of Perl Wisdom
|
|