#!/usr/bin/perl -w # whitespace_test.pl - Don Yang (uguu.org) # # Check input files for unwanted whitespaces. use strict; my $file = ""; my $line_offset = 0; while(<>) { if( $file ne $ARGV ) { $file = $ARGV; $line_offset = $. - 1; } chomp; if( /\t/ ) { my $line = $. - $line_offset; die "Tab at line $file:$line\n"; } if( /\s+$/ ) { my $line = $. - $line_offset; die "Trailing whitespace at $file:$line\n"; } }