in reply to Guessing tab size


Here is a program that a works on the assumption that a file with 4 space tabs will contain some lines that start with 4 spaces while a file with 8 space tabs will not. It skips any Pod in the file.
#!/usr/bin/perl -wn if (not /^=/ .. /^=cut/) { die $tab = "4\n" if /^ \S/; } END { print "8\n" unless $tab; }

This is far from fool-proof however. In fact I'd go as far as to say that no method is fool-proof since a file may have been edited by people with different tab/space styles.

--
John.