in reply to printing the length of string variables
#!/usr/bin/perl open FH,"inputfile"; while(<FH>){ $head=();$str=(); if($_=~m/^>/){ ($head,$x)=split(' ',$_); $head=~s/length=\d+\n+\s+//g; print $head; } else{ $str=$_; chomp($str); $len=length($str); print " Length=$len\n"; print "$str\n"; $len=(); } }
|
|---|