#!/usr/bin/perl use strict; use warnings; my $string = "Hallo Peter"; if( $string !~ /Peter/ ){ print "test"; } unless( $string =~ /Peter/ ){ print "test"; }