#!/usr/bin/env perl use strict; use warnings; my $str = 'You say *hello, but you mean *goodbye.'; my $substr = '*hello'; print "match\n" if index ($str, $substr) > -1;