Lets see if i can keep everyone happy here
...
my $line_count=0;
open (my $fh , '<', $fullfile) or die 'something';
while (my $line=<$fh>) {
last if $line_count > 29;
############## needed to add this dayum
chomp $line;
############## needed to add this
if($line=~m/^\s*CENTRAL\s*INDEX\s*KEY:\s*(\d*)/m){$cik=$1;}
if($line=~m/^\s*FORM\s*TYPE:\s*(.*$)/m){$form_type=$1;}
if($line=~m/^\s*CONFORMED\s*PERIOD\s*OF\s*REPORT:\s*(\d*)/m){$
+report_date=$1;}
if($line=~m/^\s*FILED\s*AS\s*OF\s*DATE:\s*(\d*)/m){$file_date=
+$1;}
if($line=~m/^\s*COMPANY\s*CONFORMED\s*NAME:\s*(.*$)/m){$name=$
+1;}
$line_count++;
print "$cik, $form_type, $report_date, $file_date, $name\n";
print "$line_count,' ', $line,' '\n";
}
close $fh or die 'something';
...
Off the top of my head, and Untested, YMMV