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

Two ways to do it:

1. Change your pattern as follows:

$pattern = qr/i\s*am\s*using\s*per/;

2. Make a copy of your string with the spaces removed.