#!/usr/bin/perl use warnings; use strict; my $substring = 'GATC'; while (<DATA>) { my (undef, @parts) = split /(?=$substring)/, $_, -1; pop @parts; my $distance = 0; $distance += length for @parts; printf "Average distance: %4.2f\n", $distance / @parts; } __END__ GAGAGACCCCGATCGAGAGACCCGATCFGAGAVCTGATCCCC
In reply to Re: stupid/simple mistake
by Anonymous Monk
in thread stupid/simple mistake
by gogoglou
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |