The federal government is allocating $5 million to house homeless veterans in Perth.