They are called Planaria. Not slugs. They're harmless to fish, but the problem that causes them is not.
They are a sign something hasn't been cleaned in a long time. They can come from your filter too, so be sure you're rinsing the media in tank water when you do your changes and that you have no food or yuck buildup in it.
Make sure you are cleaning under decorations and plants too. These little boogers come from filth in the tank, usually in places you miss when you clean(sometimes under something, in the filter, or in the back edges).
So, do a good clean and make sure you're not missing an area that gets a lot of food or poo build up.
Also, make sure you're cleaning up all uneaten food daily and not over-feeding your fish.
They wont harm your fish if you have them, they may even eat them. They are, however, unsightly little things. I had them once in one tank where I never cleaned under this one decoration...did when I got them, they eventually got eaten or died off after that! =)