From: Nathaniel Wesley Filardo Date: Thu, 12 Mar 2015 03:58:05 +0000 (-0400) Subject: Trim whitespace too when trimming comments X-Git-Url: https://hydra-www.ietfng.org/gitweb/?a=commitdiff_plain;h=f00c24b945015f817e626441ccb5248da06da450;p=grade Trim whitespace too when trimming comments --- diff --git a/grade.pl b/grade.pl index 737fe14..0dacb9f 100755 --- a/grade.pl +++ b/grade.pl @@ -147,7 +147,7 @@ sub finishOverall() { # {{{ } # }}} # Main dispatch {{{ while(my $line = ) { - $line =~ s/#.*$//; # trim line comments + $line =~ s/\s*#.*$//; # trim line comments next if ($line =~ /^\s*$/) ; chomp $line;