in reply to printing the length of string variables
#!/usr/bin/perl use strict; use warnings; for (;;) { my $head = <>; my $body = <>; last if !defined($body); chomp( my $seq = $body ); my $len = length($seq); $head =~ s/(length=)\d+/$1$len/; print($head, $body); }
Update: Length was off by one because of lack of chomping. Fixed. Thanks graff.
|
|---|