in reply to calculating length of the string
As you read the file content each line ends with newline character '\n', perl has function chomp() it removes characters at the end of strings corresponding to the $INPUT_LINE_SEPARATOR ($/), When given no arguments, the operation is performed on $_.
use strict; use warnings; my $arr2 = <DATA>; chomp($arr2); print "rna sequence is $arr2\n"; my $len2= length($arr2); print $len2; __DATA__ CUGUACAGCCUCCUAGCUUUCC
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: calculating length of the string
by locked_user sundialsvc4 (Abbot) on Jul 29, 2015 at 13:09 UTC |