#!/usr/bin/perl -w @ARGV or @ARGV = (qw( /usr/share/perl/5.6.1/Shell.pm )); no warnings 'uninitialized'; for my $f (@ARGV) { open(F,$f) or die "Open $f:$!"; my $tabs = 0; my $ltabs = 0; while($_ = ) { $tabs += tr/\t/\t/; $ltabs += () = m/^(\t)/g; my ($ls, $first) = m/^(\s+)(\S+)/; my ($last) = m/(\S+)\s+$/; $ls =~ tr/ /_/; my ($four, $eight) = ($ls,$ls); $four =~ s/\t/====/g; print "$four$first|$last\n" if ($ls); $eight =~ s/\t/========/g; print " "x40,"$eight$first|$last\n" if ($ls); } print "$f: $tabs $ltabs\n"; close F; } __END__ '#' should line up leading spaces count tabs are multiple of leading spaces ( can have anomalies ) if for eval { go out >> ____eval ____eval ====sub ========sub ====____if ========____if ========\$Shell::capture_stderr ================\$Shell::capture_stderr ====____} ========____} } goes in << ========____\$ret; ================____\$ret; ========} ================} ====____} ========____} ====} ========}