#!/usr/bin/env perl -l use strict; use warnings; my $string = "\t is a TAB\n is a SPACE\nTAB\t and SPACE"; print '*** BEFORE ***'; print $string; $string =~ s/(?## *** BEFORE *** is a TAB is a SPACE TAB and SPACE *** AFTER *** isaTAB isaSPACE TABandSPACE #### #!/usr/bin/env perl -l use strict; use warnings; my $string = "\t is a TAB\n is a SPACE\nTAB\t and SPACE"; print '*** BEFORE ***'; print $string; $string =~ y/\t //d; print '*** AFTER ***'; print $string; #### *** BEFORE *** is a TAB is a SPACE TAB and SPACE *** AFTER *** isaTAB isaSPACE TABandSPACE