in reply to match problem

Anonymous Monk
Or perhaps you wanted index instead of substr?:

#!/usr/bin/perl use strict; my $keyword = 'Three-element literal'; my $string = 'The fred array gets a Three-element literal'; if ((index $string, $keyword) != -1) { print "it is match!\n"; } else { print "it is not match!\n"; }

Cheers - L~R

Update: PodMaster pointed out to me I shouldn't be posting when I am overtired - changed ne to !=