>""Freddy söderlund"" <[EMAIL PROTECTED]> wrote in > message news:[EMAIL PROTECTED] >Hi! >
Hi >I have stuck my thoughts on this one, maybee someone can help me out? > >I have two arrays > >@array1 = "C:\Program files\directory1\directory2\directory3"; >@array2 = "C:\Program files\directory1\dir2\dir3"; > It looks like you're trying to build an array, each element of which is a single character from your string. What you've actually got here is two arrays both each holding a single string. >my @string_array = split('', "onetwothree"); this would build an array with an element for each character. However you can quickly compare this strings in the way you want without resorting to arrays. I've posted an answer to a similar question on this list here... http://groups.google.com/groups?q=Comparing+two+strings+for+first+difference &ie=UTF-8&oe=UTF-8&hl=en Good luck > >What I want to do is, compare the arrays, one char at a time, from the beginning and stop when I find two >chars that are different, putting the matching chars in a new scalar. > >Any suggestions? > >Greatfull for any help! > >/Freddy -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]