$string = "s005219/Doe John|John.Doe\\"; ($john) = $string =~ m#\/(.*?)\|#gsi; print $john;