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