#!/usr/bin/perl use strict; use warnings; my $foo = "Hallo Test hallo"; $foo =~ s/\s//g; print $foo;