in reply to Read file contents

$path=s/\//\/;

That would normally be written as:
$path=~s/\//\\/g;
I'm not entirely sure what your rendition would do - though it's highly likely that it won't do what you want. OTOH, it's also likely that you don't need to do that substitution - so simply removing that line of code might fix your problem.

open(FH,"$path/$file")

Always check that the open() succeeded - and print out the contents of $! if it failed:
open(FH,"$path/$file") or die $!;
(Note that you've just specified a / as the path separator - yet earlier on you deemed it necessary to use \ as the path separator.)

Update: Fixed typo that a certain pedant picked up. (Thanks almut :-)

Cheers,
Rob