WHAT is it with us and the bogeyman? Why, when we can split the atom and map the human genome, are there some things we cannot - or will not - eject from that part of our minds where the streetlights are broken and the shadows hum with menace? We seem to need bogeymen like we need to imagine ourselves jumping when we stand on high buildings or clifftops. It isn't healthy and it certainly isn't modern. SWEENEY TODD Click here to see more film trailers

Of course, there are bogeymen and there are bogeymen. Some last and some don't. Some grip a generation and are then forgotten as people become preoccupied with a new kind of threat. Others mine a richer seam, one that runs deep and wide and that can persist for centuries.

Sweeney Todd, the Demon Barber of Fleet Street, is one of these stayers. He stands there in the gloom, his razor glistening and ready, and dares us to forget him. And as the years roll by, the static he creates causes half-truth and rumour to stick to him like lint.

If you are unfamiliar with the story, here are the bones of it: Todd, a barber in 18th century London, murders scores of people for their purses and then gives the bodies to an accomplice who uses the flesh to fill the pies she bakes in a nearby cookhouse. These are, by popular reckoning, very tasty indeed.

Todd also contrives a fiendish means of dispatch for his victims, which famously involves a trapdoor, a razor, a revolving chair and a basement dungeon. A heavy blow to the head usually finishes them off if gravity hasn't already done the trick. And if even that doesn't work, Sweeney takes out his strop-sharpened blade and applies it to the jugular. "I polish 'em off," is his boast.

It's a thoroughly grisly tale but can the bodycount alone explain why Sweeney Todd has become such a potent and ever-present figure in the bogeyman line-up? Hardly. Perhaps it's the cannibalistic element, then, or the poignant image of his trusting victims offering up their necks. Perhaps it's just that callous and blood-curdling catchphrase.

Or perhaps the reason for Todd's longevity is the fact that he isn't make-believe after all. As director Tim Burton's Golden Globe-winning musical version of the story hits the cinemas, there is compelling evidence that the tale of Sweeney Todd is less rooted in fiction than we might like to believe. He may have been parlayed into urban folklore by Victorian melodramas and Hollywood films but it seems the character of Sweeney Todd might have more than a boot-heel in fact.

Tim Burton's film opens this week with Johnny Depp in the title role. Helena Bonham-Carter plays his bridie-making accomplice, Mrs Lovett, and those professional screen baddies Alan Rickman and Timothy Spall - most recently seen as Fagan in BBC One's adaptation of Oliver Twist - complete the cast.

The film is a musical and is based on Stephen Sondheim's stage version, itself a retelling of Christopher Bond's 1973 play Sweeney Todd.

It might seem an odd choice for a Sondheim production but Bond had grafted on to the popular version of the story a dramatic revenge element that appealed to the American composer. This gives Todd a motive for his crimes - he has been falsely imprisoned and his wife raped - and attempts to engender at least a little sympathy for him.

As well as Bond's addition of motive, Sondheim must also have known that serial killers were something of an obsession in 1970s America. Ted Bundy, one of the country's most notorious killers, was about to go on trial when Sweeney Todd opened on Broadway in March 1979 and Kenneth Bianchi, half of the duo known collectively as the Hillside Strangler, had been arrested only months previously. Bianchi's accomplice, Angelo Buono, was arrested in October of the same year.

Meanwhile New Yorkers who turned up to the opening night of Sweeney Todd would also have had the handiwork of David Berkowitz fresh in their memories. Dubbed The Son Of Sam, he killed six people and wounded seven others in the city between 1976 and 1977.

Until Bond's play, most tellings of the Sweeney Todd story were versions of the one that debuted in The People's Periodical - one of the so-called "penny dreadfuls" - on November 21, 1846. The author was anonymous but his is essentially the first novelisation of the legend.

It proved so popular that a year later it can be found forming the basis of George Dibdin Pitt's play The String Of Pearls or The Barber Fiend Of Fleet Street. It premiered at the Britannia Theatre in Hoxton on March 1, 1847. Many more versions followed both in print and on stage and by the end of the 19th century Sweeney Todd was a regular in popular fiction.

The emphasis then remained on the blood and gore, but today most retellings of the story have adopted the template set down by Bond and Sondheim. The most recent example was a BBC production in 2006 starring Ray Winstone and produced by Gub Neal, the man behind Cracker and Prime Suspect.

"We've given the story a modern psychological complexity," Neal said at the time, "having a character who finds himself compelled to do something that he knows is wrong but who cannot stop himself. So he is caught up in the tragedy of being aware of what this is doing to him, like Macbeth or Richard III."

Sweeney Todd is not an odd choice for Tim Burton, however. In fact it's a perfect fit. Though not a fan of musical theatre, he saw Sondheim's production when it transferred to London's West End in 1980.

He was a student at the time and hadn't yet embarked on the Oscar-winning film career that would see him make gothic fantasies like Edward Scissorhands and Sleepy Hollow, both starring Johnny Depp. But it appealed to his darker side: this, after all, was the man who used to frighten his parents' neighbours by staging fake axe murders with his brother.

"I didn't know anything about the show, I just wandered into the theatre and it blew me away," Burton recalls. "I went three nights in a row because I loved it so much." He had never even heard of Stephen Sondheim before taking his seat.

Given the success of their previous collaborations, Depp was an obvious choice for the role of Sweeney Todd. But in creating the part, both he and Burton have turned to a different sort of folklore - the celluloid one carved out in Hollywood by actors such as Bela Lugosi, Lon Chaney, Peter Lorre and Tod Slaughter, who played Sweeney Todd in a 1936 film version.

"It's a classic kind of story," says Depp, "but these horror movie actors kept coming to mind, these iconic figures, and that's where he Sweeney Todd lives."

Burton agrees. "You see Peter Lorre in Mad Love or you see Boris Karloff or Lon Chaney, all those old classic monsters we just felt like that was what this character is about. You could see him in a wax museum."

In other words, their Sweeney Todd has no basis in fact. As far as Depp is concerned those who comb the archives looking for real flesh to put on the ghoul's bones are simply chasing shadows.

"There was part of me that reads all that stuff and wants him to be a real guy," says Depp. "You go, Yes, please let him be real, I'd really love that'. But it's not the case. Basically, you read all of that stuff so you can throw it away."

But "that stuff", as Depp calls it, has convinced some people, among them the editors of the Dictionary Of National Biography, who included Sweeney Todd in their 2004 edition, and journalist-turned-historian Peter Haining. Haining died last month but not before completing a new version of a book he had spent half a lifetime compiling.

In it he contests that Sweeney Todd was a real person and, while maddeningly vague about some of his sources, he presents a biography of the killer, which starts with his birth in Brick Lane on October 26, 1756 and continues through his abandonment by his parents in his early teens, his spell in Newgate Prison aged 14, his apprenticeship to a barber named Crook and the setting up of his red-and-white barber's pole outside a shop at the top end of Fleet Street in 1785.

The string of murders he then embarks on only ends with his capture and subsequent execution in Newgate Prison on the morning of Tuesday, January 25, 1802 - 206 years to the day before the release of Tim Burton's film.

Much of the detail of Sweeney's life and crimes comes from a later account in the Newgate Calendar, a publication that covered all of the most lurid crimes and trials of the 18th and early 19th centuries and which had the wonderful subtitle The Malefactor's Bloody Register.

But is it to be trusted? Or is it simply one of the first examples of the Sweeney Todd story finding its way into the mass media? Haining thinks the former, of course.

In truth, the fear of murder and the taboo surrounding the eating of human flesh is a constant in all mythologies from the Greeks onwards. Pity poor Thyestes, for instance, whose twin brother Atreus fed him his own sons as revenge for Thyestes's seduction of Atreus's wife. Those looking for a more specific forerunner to the Sweeney Todd legend point to the story of Sawney Beane, the son of an East Lothian ditch-digger who murdered and ate scores of people during the reign of James VI - at least according to the Newgate Calendar.

The notion of a barber who kills his customers instead of shaving them didn't start in the 18th century either, and neither is it exclusive to London.

A 15th-century mediaeval ballad tells of a demon barber and a version of the same song published in 1845 has him living at 24 Rue des Marmouzets in Paris, "his accomplice a villainous pie merchant next door".

A separate story from 1800 tells of a killer barber at Rue-de-la-Harpe in the Faubourg of St Marcell. Even Calais has a version of the same tale.

So why barbers? With witches out of the picture as figures of fear by the late 18th century, they were an obvious choice for culprit because they still doubled as surgeons, as they had since the Middle Ages. Accordingly they had a suitably grisly reputation, not helped by their adoption of the red-and-white striped pole as a professional emblem - it symbolised the blood-soaked bandages that were often a consequence of their well-meaning ministrations.

None of this means that Sweeney Todd did not exist, but it sets up a framework of myth into which he slots rather too neatly. Still, whatever the truth, we know that his effect is real. We read about his crimes and, whether they happened or not, they still terrify us at some primal level.

The sad truth is that bogeymen (and women) are still with us as a concept, even if their faces change from century to century.

And change they do, so that Jack the Ripper becomes Bible John, Moll Cutpurse becomes Myra Hindley, Sawney Bean becomes Jeffrey Dahmer.

Or, because we live in a mediated age, perhaps today's bogeymen come from films, television series and computer games as much as from real life, transcending their medium and stepping off the screen.

Think of Norman Bates in Psycho, Freddy Krueger in the Nightmare On Elm Street films, or Hannibal Lecter, who served up his victims with fava beans and a nice Chianti.

As Tim Burton's film prepares to drape another layer of half-truth over the Sweeney Todd story - with songs and music as part of the deal - we can only really guess at the shape that lies underneath it all. It might be the outline of a real man; it might be an assemblage of rumour, myth and folklore.

In the end, it doesn't really matter of course: whether we look in the mirror and see a razor-wielding barber or simply a reflection of our own deepest fears, the effect is the same.

Now, anyone for a haircut?

Sweeney Todd: The Demon Barber Of Fleet Street opens nationwide on Friday. Tim Burton is the subject of The South Bank Show tonight (STV, 10.40pm)