#!/usr/bin/env perl
# Usage: fastaRead.pl data.fa
use strict;
use warnings;
my $filename = $ARGV[0];
my $sequence;
open my $fileH, "<", $filename or die "could not open $filename\n";
while (<$fileH>) {
chomp;
if ($_ =~ /^>/) {
print "this line is a header: $_\n";
}
else {
print "this line contains sequence data: $_\n";
# Concatenate everything from the file into a single var
$sequence .= $_;
}
}
close $fileH;