If anyone can help,that'll be super. I'm no expert to programming and new to Perl. I'm trying to do 2 main simple things. 1 - Count the rows of an input file and print the count, and 2 - print each row in sequence. It works when I run these 2 scripts separately, but not together as followed:
test();
sub test {
$count = 0;
$count++ while (<>);
print "COUNT = $count";
while (<>) {
chomp;
print $_."\n";
}
}