how to use "sed" to replace old directory to new directory in a file



All
please guid me....
i want to know how to replace the old directory to new directory in a
file..

example: let us consider the below line
open (LOG,">>/user/xxxx/yyyy/zzzz/aaaa/bbbb/.cccc") || die;

to
open (LOG,">>/wwww/qqqqq/pppp/rrrrr/ssss/tttt/.lllll") || die;


like this i want to replace many lines in which each line has different
directories to new different directory


i tried with
oldpath=/user/xxxx/yyyy/zzzz/aaaa/bbbb/.cccc
newpath=/wwww/qqqqq/pppp/rrrrr/ssss/tttt/.lllll
cat -n filename | grep 61 | sed "s/$oldpath/$newpath/" filename
am getting error
(where 61 is the line no. where i have to do changes...)
help me pls...
waiting for reply

thanx n advance

sk

.