I don't know if there's a problem with the number showing on text messages, but there were 2 changes in cellphone "numbering", both done to get rid of the regional-cellphone problem.
First, back in 2008,
numbers were switched to 9 digits. Up to this point, Lima cellphone #s were 8 digits and other cellphone #s were 7 digits.
If you wanted to call a Cusco cellphone from abroad, you had to call +51-84-XXX XXX XXX.
Then, a year ago, area codes stopped being necessary for cellphones. Now, to call any cellphone from abroad you just dial +51-XXX XXX XXX. This was good because finally it costs the same to call cellphones anywhere in Peru. It also became necessary to add the area code when calling a landline from a cellphone.