Question: ```
chomp($myString);
$myString =~ s/\///g;

```

can i replace those two with

```
$myString =~ s/\s//g;

```

are there any difference? Please explain.

Answer: 
Your first code will take a newline off the end of $myString if it exists and then remove all "/" characters. The second line of code will remove all whitespace characters. Is there a typo? 

Maybe you want to know you can replace this:

```
chomp($myString);
$myString =~ s/\s//g;

```

with this:

```
$myString =~ s/\s//g;

```

If that's the question, then yes. Since a newline counts as whitespace, the second code example do the job of both lines above.
Chomp will get rid of newlines at the end of your string, but won't remove whitespace. A typical trim function uses the following two substitution lines:

```
$string =~ s/^\s+//;
$string =~ s/\s+$//;

```

The first line removes any spaces at the beginning of your string, and the second removes spaces after the end of the string.