Since the movie is based on a book with which none of the principals cooperated or contributed, there is some question as to the accuracy. Most of what is expressed as factual was apparently pulled from the public records of various lawsuits. There's no telling what really went on that was off the record.
But this is what's so cool about the expository scene in which the Mark Zuckerberg character narrates Zuckerberg's creation of Facemash. He's reading Zuckerberg's real online blog posts verbatim in cinematic real time. These posts are in the public domain and are available online.
So the principal did, indeed, contribute dialogue — monologue, actually — to the film. The references to Perl, Emacs, wget, etc. are from the horse's mouth.