fabalicious has asked for the wisdom of the Perl Monks concerning the following question:
$s = "evian-eauminerale"; $t = "borisvian-ecrivain"; foreach my $i (1..length($s)) { foreach my $j (1..length($t)) { if (substr($s, $i-1, 1) eq substr($t, $j-1, 1)) { $M[$i][$j] = $M[$i-1][$j-1]+1; $M[$i-1][$j-1] = 0; } } } foreach @array (@M) { foreach $element (@array) { print "$element "; } print "\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: multi-dimensional arrays, dereferencing
by thinker (Parson) on Aug 08, 2003 at 10:14 UTC | |
|
Re: multi-dimensional arrays, dereferencing
by Skeeve (Parson) on Aug 08, 2003 at 10:12 UTC | |
|
Re: multi-dimensional arrays, dereferencing
by thinker (Parson) on Aug 08, 2003 at 12:12 UTC | |
|
Re: multi-dimensional arrays, dereferencing
by fabalicious (Novice) on Aug 08, 2003 at 10:23 UTC | |
by thinker (Parson) on Aug 08, 2003 at 10:35 UTC | |
by Not_a_Number (Prior) on Aug 08, 2003 at 10:52 UTC | |
by Skeeve (Parson) on Aug 08, 2003 at 11:12 UTC |