A former News of the World journalist has told a perjury trial that editor Andy Coulson suggested he would keep his job at the paper if he pleaded guilty to phone-hacking.

Clive Goodman, 57, told jurors that the price he had to pay was to admit to being a "lone wolf".

The witness said after being released from police custody in August 2006 that he spoke to Coulson on the phone the following day and he "seemed to think we needed to get it out of the way quickly".

Goodman told the High Court in Edinburgh, where Coulson is accused of lying under oath in the 2010 trial of former Socialist MSP Tommy Sheridan, that he felt "really confused and suspicious" during the conversation.

He said the pair met a few days later at a cafe in Wimbledon and Coulson's "recommendation" to him was to plead guilty at the earliest opportunity.

The witness said Coulson's suggestion was that there could be a "way back" for him at the paper afterwards in a less public position.

"The price for that was to say I was a lone wolf and I had strayed off the reservation," Mr Goodman said.

Mr Goodman had been working for the tabloid as royal editor when he was arrested in August 2006 with private investigator Glenn Mulcaire over phone-hacking allegations.

The court has heard the pair both pleaded guilty and Mr Goodman was sentenced to four months imprisonment.

Mr Goodman told the jury yesterday that Coulson was aware phone-hacking was happening while he was editor.

Coulson, 47, is accused of falsely stating he did not know about phone-hacking at the paper after being sworn in as a witness at Mr Sheridan's trial.

The ex-Sunday newspaper editor, who went on to become director of communications at Downing Street, is accused of falsely stating he did not know that Mr Goodman was involved in intercepting voicemail messages before Mr Goodman's arrest on August 8 2006.

He denies the charges.

On day four of the trial, Mr Goodman was asked by Advocate Depute Richard Goddard, prosecuting, if he was concerned when police showed him the "material" in their investigation.

The witness said: "I thought I would be left as the fall guy for the whole thing, I would end up being blamed for everything."

He told the jury of nine men and six women that he recorded the conversation between him and Coulson when they met face to face in the cafe but said the tape had not worked.

He made a note from memory of the conversation then typed it up when he returned home, he said.

Jurors were then shown the typed-up note in which he had written that he believed Coulson wanted to offer him an "employment deal". He wrote that it was "in return for me to explain my alleged actions by confessing I had gone off the reservation".

Mr Goodman received a dismissal letter from the News of the World a few days after he was sentenced on January 26 2007 for phone-hacking, the court heard.

He appealed against the decision through the newspaper group's internal process and wrote a letter to HR setting out his grounds.

Part of Mr Goodman's letter was read to the jury.

It said: "The decision is perverse in that the actions were carried out with the full knowledge and support of the editor Andy Coulson."

The letter also stated that the decision was inconsistent since other members of staff "were carrying out the same procedure".

Mr Goodman confirmed to the court that by "procedure" he was referring to phone-hacking.

A settlement was eventually agreed by Mr Goodman and the paper, the jury heard.

The jury later saw email conversations between the witness and Coulson, while they still worked together, which they heard related to the purchase of a "green book" or telephone directory used by members of the royal household.

In an email dated January 24 2003, Mr Goodman wrote: "Andy - one of our royal policemen (St James Palace) has obtained a brand new green book, the telephone directory with all the home numbers of the royal family and their household staff."

The email went on: "The standard price is £1,000."

A reply from Coulson states: "This is fine. Didn't I sign off on purchase of green book quite recently tho (sic)?"

Goodman said in a further message: "In December - that was £750 for the internal phone directory. Lists all the staff at BP, SJP and Widnsor (sic) with their external numbers and direct lines.

"This is the hardest to get one which has the Queen's direct lines to her family in it."

Mr Goodman was shown a document in court which he identified as the "£1,000 one" and agreed with Mr Goddard that it was "one of the items that Mr Coulson had given you permission to buy".

He told the court he had got them from "people in journalism" who had passed them on to him.

Mr Goddard said: "Why did you tell Andrew Coulson that you got it from a copper?"

Mr Goodman said: "It's very common for journalists to exaggerate their sources."

Prosecutors allege that between December 1 2002 and 26 January 2007 Coulson understood that payments had been made to corrupt police officers by Mr Goodman, specifically payments of £750 around December 2002, £1,000 around January 2003 and a further payment of £1,000 in June 2005, all to procure a "green book" or similar directory. He denies the claim.