#!/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=(); } }
In reply to Re: printing the length of string variables
by sanku
in thread printing the length of string variables
by sugar
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |