in reply to Pls explain this syntax

Regarding this question:

4) (my $basename = $name =~ s#./##; # how come there is only one forward slash ?

You're allowed to use characters other than '/' as regex delimiters. This is usually done if the regex contains the '/' character. Otherwise you have to escape it with '\'. So, for your example, you can use either of these:

(my $basename = $name =~ s#./##;
(my $basename = $name =~ s/.\///;

The notion being that all those backslash escapes make the regex less readable.