in reply to Re: FInding the longest match from an initial match between two files
in thread FInding the longest match from an initial match between two files

After fixing all the issues with ()/{}, the error is now with an uninitialized value in string eq at line 73 "$m++;" but I am thinking that perhaps I need to expand the if loop that contains the arrays to include $l and $m. As for the <IN>, doesn't reading into $query allow me to access the string outside of the first while loop?
  • Comment on Re^2: FInding the longest match from an initial match between two files

Replies are listed 'Best First'.
Re^3: FInding the longest match from an initial match between two files
by GrandFather (Saint) on Nov 08, 2016 at 23:25 UTC

    Your uninitialized value is most likely due to trying to access an element beyond the end of one of the two arrays. Consider what happens when the content of the two arrays is identical.

    I haven't looked at the logic of your code in any detail, but my impression is that you are not taking any advantage of the string processing power that Perl provides. In particular splitting strings up into arrays of characters smells really bad.

    Premature optimization is the root of all job security