in reply to Re^2: Generalising string in pattern
in thread Generalising string in pattern

Again, consult perldoc perle. Using a character class containing only a space is one of many ways to do this.
my $pattern = qr(i[ ]*am[ ]*using[ ]*per);

And, when you post code, you'll help yourself by first checking that code by:

use strict; use warnings

and then perl -c scriptname.

The apparent failure to do the above; the apparent failure to take several pieces of advice in previous replies; and the missing semi-colons suggest that you don't care so much about learning from the wisdom of the Monks as about using them to write your code.

Replies are listed 'Best First'.
Re^4: Generalising string in pattern
by rajyalakshmi (Acolyte) on Nov 13, 2009 at 14:54 UTC

    I do not want generalise $pattern.I want my search of the $pattern which is without spaces ignore the spaces in the $string

      If you want to ignore whitespace, you will have to create a new pattern.