use strict; use warnings; my $testString = "Test Hallo Test"; if($testString =~ /(Hallo)/) { print "true $1\n"; } else { print "false\n"; }