Your command works just fine. I guess you have the line number wrong?
With a test.tex
file like this
aa
bb
cc
aa bb cc JAI dd ee ff
bb
cc
aa bb cc JAI dd ee ff
xx
yy
zz
the command
perl -p -i -e 's/JAI/ramkrishna/ if $. == 7' test.tex
changes the file to
aa
bb
cc
aa bb cc JAI dd ee ff
bb
cc
aa bb cc ramkrishna dd ee ff
xx
yy
zz