1: #!/usr/bin/perl 2: #this programs prompts a user for a filename and then 3: #replaces all tabs in that file with 3 spaces. 4: print "What file do you want to \"detabify?\" "; 5: $file=<>; 6: chomp $file; 7: $/=undef; #changes the input record separator so it'll read the entire file in at once 8: open FILE, "<$file"; 9: $text=; #reads the entire file in 10: close FILE; 11: $text=~s/\t/ /g; #replaces tabs 12: open FILE, ">$file"; 13: print $text; #write changes to file 14: close FILE;