This splits using a regular expression, matching between 1 and 3 characters per "chunk", and it'll endeavour to match as many characters per chunk as possible.#!/usr/bin/perl use warnings; use strict; use Data::Dumper; while(<DATA>) { chomp; my @triplets = $_ =~ /(.{1,3})/gs; print Dumper \@triplets; } __DATA__ atgcatccctttaat tctgtctga
In reply to Re: splitting a sequence using unpack
by davis
in thread splitting a sequence using unpack
by Rashmun
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |