1 2 3 4 5 6 7 8 9 10 11 12 13
my @strings = ( "Hello world", "multi\n line string", "tabbing\talong\twith spaces", ); foreach my $s (@strings) { my $t = $s; $t =~ s/\s*//g; print "$s -> $t\n"; }
1 2 3 4 5 6
Hello world -> Helloworld multi line string -> multilinestring tabbing along with spaces -> tabbingalongwithspaces