Perth has seen temperatures soar to more than 42 degrees, leaving thousands of West Australians flocking to the coast.