find ./ \( -name "*.h" -o -name "*.cpp" \) -exec perl -i.bak -lpe 'print "\n" if eof' {} \;
ps: the space between the '{}' and '\;' at the end is required and there is no space in between "\;". else the follwing error occurs
find: missing argument to `-exec'