#!/usr/bin/perl -w #Spell checking script in perl for GIT source tracker program. #Should be part of pre-commit hook use Text::Aspell; my $filename; my $continue = 0; open($filename,"./checker.sh") or die "Could not open file"; my $speller = Text::Aspell->new; die unless $speller; while(<$filename>) { if(m/\/\*/ || $continue == 1) { @words = split / /,$_; foreach $word (@words) { if($word eq "*/") { $continue = 0; last; } else { print $speller->check($word) ? "$word found\n" : "$word not fouund \n"; } $continue = 1; } } next; } close $filename;