in reply to substitute 4 spaces instead of a tab

You don't want to search for the substring "\t", but for a tab - therefore you should not escape the "\" in "\t".
$line =~ s/\t/ /g;