Why are you comparing lines char by char? I mean, what's the purpose? Are you sorting the lines? (use
cmp) Are you looking for something? (use a regular expression) I'm not sure I can think of a reason to split a string into its member chars, except maybe to scramble it, or find usage stats for various chars (also done better with a regex). Share your problem statement with us, and maybe we can cook a better solution.
Oh, and mikfire is right about your misuse of split. It returns an array, which in scalar context is a size.