/(.+)\n/ #### /## while () { chomp; #if necessary if ($_ =~ m/(.+)\n/) { push @fnote, $1; } } my $numfootnotes = scalar @fnote;