]> hydra-www.ietfng.org Git - grade/commitdiff
Trim whitespace too when trimming comments perl
authorNathaniel Wesley Filardo <nwf@cs.jhu.edu>
Thu, 12 Mar 2015 03:58:05 +0000 (23:58 -0400)
committerNathaniel Wesley Filardo <nwf@cs.jhu.edu>
Thu, 12 Mar 2015 03:58:05 +0000 (23:58 -0400)
grade.pl

index 737fe14ae2b25afb9098afb7e81d8a26ed0f3405..0dacb9f25a0c27053858c7d5b5cab9bbc0010cea 100755 (executable)
--- a/grade.pl
+++ b/grade.pl
@@ -147,7 +147,7 @@ sub finishOverall() { # {{{
 } # }}}
 # Main dispatch {{{
 while(my $line = <STDIN>) {
-  $line =~ s/#.*$//;    # trim line comments
+  $line =~ s/\s*#.*$//;    # trim line comments
   next if ($line =~ /^\s*$/) ;
   chomp $line;