I\'m grabbing a few columns from a tab delineated file in Perl. The first line of the file is completely different from the other lines, so I\'d like to skip that line as fast a
You can read a file in a file handle and then can either use array or while loop to iterate over lines. for while loop, @Guru has the solution for you. for array, it would be as below:
#!/usr/bin/perl
use strict;
use warnings;
open (my $fh, '<','a.txt') or die "cant open the file: $! \n";
my @array = <$fh>;
my $dummy = shift (@array); << this is where the headers are stored.
foreach (@array)
{
print $_."\n";
}
close ($fh);