aparna_pall has asked for the wisdom of the Perl Monks concerning the following question:

Hi, I am trying to match each char in two string arrays and push a "*" when they match.I am catching the "*" results in to another 2D array. While I am printing the star array,I am getting some blank lines,infact many. i trimmed all the spaces from the input arrays.They are clean. unable to figure out why/how its happening. Please help me. thx.

Replies are listed 'Best First'.
Re: 2D string array
by Corion (Patriarch) on Apr 30, 2008 at 18:02 UTC

    The error is on line 16 of your script.

    Also see How (Not) To Ask A Question.

    My approach would be:

    my $matches = $left ^ $right; $matches =~ s/(.)/$1 eq "\0" ? '*' : "_" /eg;