in reply to extract ouput that counts strings starting with A in the dataset

$output[0] is the first element of the array @output. What you need there is the first character of $line, which is
substr($line, 0, 1) eq 'A'

Also, there is a precedence problem on your open line. Use or instead of ||, otherwise your statement means

open DATA, ( "<piRNA_Dataset" || die "..." )
which will never die.

Replies are listed 'Best First'.
Re^2: extract ouput that counts strings starting with A in the dataset
by MVRS (Acolyte) on Feb 29, 2012 at 05:07 UTC
    Thankyou very much choroba , similarly i also want end of the string , but these are of different length , can you suggest me in this
      The last character is
      substr $line, -1
      If you do not chomp your input, though, this might return end-of-line.