To be, or not to be, I there's the point,
To Die, to sleepe, is that all? I all;
No, to sleepe, to dreame, I mary there it goes

It's Hamlet's greatest soliloquy, but not quite as we know it. The first published version of the play commonly regarded as Shakespeare's best was yesterday revealed as a travesty of the drama that helped shape the modern English language.

The version of Hamlet known as the "bad quarto" is a salutary warning of the dangers of literary piracy. An entrepreneurial player in Richard Burbage's company at the Rose Theatre, where Hamlet is believed to have been first staged, beat the Bard to the press with a version of the play he remembered from rehearsals and its first performances in 1600.

While the bit player - whose identity has been lost in the mists of time - was spot-on with his own lines as Marcellus, one of the king's guard, and those of everyone else who appears in the first scene, after that his recollection left a lot to be desired.

Now the British Library has produced a facsimile edition, for the first time, from its copy of the "bad quarto", only one of two still in existence.

Whole scenes were left out of the bootlegged edition, published in 1603, a year before the much more reliable "good quarto" was published, apparently with the Bard's blessing. Others were inserted, including one in which Hamlet's friend Horatio reads a letter he has sent from England to the Queen.

With intellectual property rights unheard of, Elizabethan scribes and players were well versed in the dark arts of cobbling together spoilers and rip-offs of the hits of the day. Moira Goff, head of British Collections (1501-1800) at the library, said this kind of skulduggery was common.

"Like film and theatre today, these were commercial operations and, with successful dramas, printers, publishers and actors all wanted a part of the action," she said. "The whole business of publishing plays was only beginning to develop. Rival players would often go to performances and then try to record what they had seen and heard."

The bad quarto is only about half the length of the version of Hamlet we know, because of the rogue actor's "conflations, omissions and paraphrasing".

That wily plotter Polonius, for instance, morphs into the equally slippery Corambis, who offers the prince of Denmark his daughter Ophelia. "The 'Get ye to nunnery' scene comes much earlier in the play, just after Polonius has hatched his plot," Ms Goff said.

Despite its dodgy provenance, elements of the bad quarto did eventually appear in the first folio edition of Shakespeare's collected plays, after his death in 1623.

"Theatre, then as now, is as much an oral tradition as a written one," Ms Goff explained. "Various versions of the play were staged, and it kept changing, so the folio version draws on both the good and bad quartos."

Scholars have been exercised since on trying to divine the real Hamlet. "A lot of ink has been spilled on this over the years," she added.

Original copies of the good and bad quartos are on display at the library in London in an exhibition which also features a version of the play translated into Klingon, the alien language spoken in the television series Star Trek.

The two versions

Hamlet 's soliloquy 'To be, or not to be' opening lines

Bad quarto:To be, or not to be, I there's the point, To Die, to sleepe, is that all? I all: No, to sleepe, to dreame, I mary there it goes,

Good quartoTo be, or not to be, that is the question, Whether tis nobler in the minde to suffer The slings and arrowes of outragious fortune,

Hamlet 's soliloquy [Act I, scene II ]

Bad quarto:'O that this too much griev'd and sallied flesh Would melt to nothing, or that the universall Globe of heaven would turne al to a Chaos!

Good quartoO that this too too sallied flesh would melt, Thaw and resolve it selfe into a dewe, Or that the everlasting had not fixt His cannon gainst seale slaughter, O God, God,

Ghost of Hamlet 's father [Act I, scene V ]

Bad quarto:I am thy fathers spirit, doomd for a time To walke the night, and all the day Confinde in flaming fire,

Good quarto:I am thy fathers spirit Doomd for a certaine tearme to walke the night, And for the day confind to fast in fires,

· A limited-edition reprint of the bad quarto is now on sale at the British Library