in reply to logic behind the print function
What did you expect?
Perl evaluates the arguments to all calls to print from leftmost-innermost to right. So it first prints the 7, then prints the result from the print function +10.