Fix code to delete blank lines to remove all blank lines;

Update some Perl usage.

svn path=/trunk/; revision=47569
This commit is contained in:
Bill Meier 2013-02-08 16:25:46 +00:00
parent 73b49715c9
commit f5dd71e30e
1 changed files with 7 additions and 7 deletions

View File

@ -139,6 +139,7 @@ while (my $fileName = $ARGV[0]) {
## $noArrayHRef = diff_hash(\%hfDefs, \%hfArrayEntries);
$noArrayHRef = diff_hash(\%hfStaticDefs, \%hfArrayEntries);
$noArrayHRef = diff_hash($noArrayHRef, $unUsedHRef); # Remove "unused" hf_... from noArray list
print_list("ERROR: NO ARRAY: $fileName, ", $noArrayHRef);
if ((keys %$noArrayHRef) != 0) {
@ -168,13 +169,12 @@ sub read_file {
# delete leading './'
$$fileNameRef =~ s{ ^ \. / } {}xo;
$$fileContentsRef = '';
# Read in the file (ouch, but it's easier that way)
open(FCI, "<", $$fileNameRef) || die("Couldn't open $$fileNameRef");
while (<FCI>) {
$$fileContentsRef .= $_;
}
close(FCI);
open(my $fci, "<:crlf", $$fileNameRef) || die("Couldn't open $$fileNameRef");
$$fileContentsRef = do { local( $/ ) ; <$fci> } ;
close($fci);
return;
}
@ -216,7 +216,7 @@ sub print_list {
sub remove_blank_lines {
my ($codeRef, $fileName) = @_;
$$codeRef =~ s { ^ \s* $ } []xomg;
$$codeRef =~ s { ^ \s* \n } []xomg;
return;
}