A few others in his line of work, however, look set to achieve his dream of making it to Europe - courtesy not of the people smugglers' boats, but of the multinational anti-piracy force charged with tackling them. That is the extraordinary story that has unfolded in recent weeks in Room 35 of the maximum security court building in Rotterdam, where five Somali pirates, dressed in borrowed clothes and looking variously confused, bored and cheerful, have sat in front of a judge, lawyers and a contingent of armed policemen. It is fair to say they are not the most formidable buccaneers of their time; they were arrested by a Danish warship after a crewman on the freighter they tried to hijack set their skiff ablaze with a well-aimed petrol bomb. They are, however, assured a place in pirate folklore. After being picked up they were taken to the Netherlands, where they are the first pirates to stand trial in Europe in living memory. The Netherlands, which brought the case because the warship, the Samanyolu, was registered in the Dutch Antilles, hopes it will show that the West is serious about the Somali piracy problem. It is prosecuting the men for attempted ''sea robbery'', under laws first drafted in the 17th century. But the problem is that, 300 years on, the official message that piracy is a mug's game is somewhat less clear than it used to be. After all, back in the days of sail, when pirates were last a serious threat to maritime commerce, official thinking was quite literally of the ''hanging's too good for 'em'' school. At the old Admiralty court in London, for example, pirates would drop from a rope that was cut deliberately too short to break their necks. After slowly asphyxiating - and doing a grisly leg-thrash known as the marshal's dance - their bodies would be taken to a gibbet, and displayed as decaying, maggot-riddled warnings to others.

By contrast, when the Rotterdam case finished yesterday, the worst they received was five years in a comfortable Dutch prison, where each will have a private cell complete with television, lavatory and shower. Prosecutors asked for a seven-year sentence, but the judge said he took into account the difficult conditions in Somalia that led the men to piracy. Once they are freed, moreover, they will be able to apply to stay in the Netherlands - the very chance that my old acquaintance Fraisal used to dream of. Small wonder, then, that those in the dock in Rotterdam have begun to think that things haven't worked out quite so badly after all. ''When I first spoke to my client, he said being here was like heaven,'' Willem-Jan Ausma, a lawyer who represents Farah Ahmed Yusuf, 27, said. ''For the first time in his life he didn't feel he was in danger, and he was in a modern prison with the first modern lavatory and shower that he'd ever had.'' The case is just one illustration of the difficulties the West is having in posing any real deterrent to Somalia's pirate armadas, which continue to terrorise shipping in the Gulf of Aden and the Indian Ocean. Since the problem first began escalating in 2008, an international fleet of warships has been patrolling the waters off Somalia, policing a ''safe transit corridor'' and advising ships on how to take evasive measures. Yet the chance to share in a multimillion-dollar ransom ensures there is a never-ending influx of desperate people willing to join the pirates' ranks. Attempted hijackings went up to 217 last year, nearly double the 111 recorded in 2008, and while a smaller proportion of them were successful - roughly one in four last year, compared with one in three the year before - an estimated 200 sailors still languish as hostages. On Friday, the Eastern European crew of the British-flagged Asian Glory were freed after six months in captivity following the payment of a ransom. As I sat in the public gallery of the court in Rotterdam recently, I wondered whether I was that impartial an observer. The face of one defendant bore a passing resemblance to one of my own captors, and when I heard about the crew fending them off with a petrol bomb, I almost muttered a cheer.

All the same, listening to the pirates' defence, it was clear how little most of them felt that they had to lose. Like many other men from the dirt-poor fishing communities that dot the Somali coast, they turned to piracy after rumours swept their villages about the multimillion-dollar ransoms that could be gained. While their testimony has at times seemed exaggerated - one claimed that Somalis ate their children through hunger - all five claim to have been simply ordinary family men looking to put food on the table. ''I would not have done this if I hadn't had so much trouble of my own,'' said Abdirasaq Abdullahi Hirsi. ''Before I was arrested, 18 people depended on me. They now have no home or food or family to fall back on.'' For all their concerns about their extended families, none now seem keen to return home. Instead, all five have asked to remain in the Netherlands, and to bring their families to join them upon release from jail. The court told them that they are here to ''answer for their crimes'' rather than seek asylum. Mr Ausma points out that the Netherlands, like Britain, deems Somalia too dangerous to repatriate people to. ''When it is not possible to send them back to their own country, the judge will just have to set them free, like thousands of other Somalis who are here already,'' he said. Lenient though their treatment may be, however, the ''Rotterdam Five'' have at least seen the inside of a courtroom. The vast majority of pirates being apprehended by the international naval force never even get close, thanks to the controversial ''catch and release'' policy, under which only those caught directly in the act of hijacking are generally taken into custody. Others simply have their weapons confiscated and are told to go on their way. The justification is that prosecutions in foreign courts are too time-consuming and expensive, and that it is more practical simply to disrupt the pirates' activities. But critics in the shipping industry, which has paid out nearly $200 million ($232 million) in ransoms in the past two years, have likened it to catching an armed robber on the way to a bank and letting him off with a caution.

Until recently, one alternative had been to take the pirates to Kenya, which undertook to try suspects arrested by Britain and other nations. Eight pirates detained by a Royal Navy vessel were recently jailed there for 20 years, and most diplomats agree that an African prison is likely to be more of a deterrent than a Dutch one. But in April, the Kenyan government announced it would not be accepting any more, amid concerns about overloading the system and the fallout of becoming the ''Pirate Guantanamo Bay''. Which means that people like my old friend Fraisal will no doubt continue to find piracy an attractive career option, offering as it does fairly reasonable odds in the lottery of life. If they don't get a share in a multimillion-dollar ransom, the worst they risk is a slap on the wrist from a foreign navy. Or - if they are really lucky - the chance to start a new life in Europe. As I left the court, I couldn't help wondering whether the Rotterdam Five might prove to be the luckiest pirates on the high seas - and whether, one of these days, I might get that knock on the door from Fraisal. Telegraph, London, and AAP