in reply to Request to sort out a problem in perl program for getting result as print "@a or $a" of a map function code
simply changes tosay $fh length for split $motif, $string;
open(my $fh, '>', $qfn) or die("Can't create \"$qfn\": $!\n"); say $fh length for split $motif, $string;
No need to involve a variable, which would be done as follows:
my @lengths = map length, split $motif, $string;
|
|---|