in reply to substr help
Here's a little different way to do it.
With PerlIO, Perl 5.8+,
That makes use of the PerlIO trick of opening a scalar as a file by putting a reference to it in open's filespec slot. Setting $/ to a reference to constant three makes any filehandle be read three characters at a time. Setting $\, the output record seperator, to newline inserts one after every print statement executed.my $dna = q(accatgagctgtacgtagcatctgagcgcgcatgactgtgactgacgtaggcagca); my $skip = 10; { local ($/, $\) = (\10, "\n"); open my $chain, '<', \substr($dna, $skip) or die $!; print while <$chain>; close $chain or die $!; }
Update: Oops, I also misread. Not a solution to what was asked.
After Compline,
Zaxo
|
|---|