The result is: It is not match! Why? How can I find whether keyword is inside a string or not? Thanks!!#!/usr/bin/perl use strict; my $keyword = 'Three-element literal'; my $string = 'The fred array gets a Three-element literal'; if ($keyword =~ substr ($string, 0, length $keyword)){ print "it is match!\n"; }else { print "it is not match!\n"; } exit;
In reply to match problem by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |