I am trying to match a sub-string with a given string in perl.

Match is failing when the sub-string contains space.

Example:

Please consider the following string variable:

```
var = "test [abc], def, xyz,"

```

The expression:

```
($var=~ m/test [abc]/)

```

doesn't return 1.

Strings without spaces are working fine:

```
Example:

($var=~ m/def/)

is returning 1.

```

Please help.

Thanks