Hacking phones was "systematic" at the News of the World, the perjury trial of the newspaper's former editor has heard.

James Weatherup, a one-time news editor at the tabloid, also told the High Court in Edinburgh that Andy Coulson "would have known" a private investigator employed by the now-defunct paper was a phone hacker.

Coulson, 47, a past editor of the Sunday tabloid and the Prime Minister's former director of communications, is on trial accused of lying under oath in the 2010 perjury trial of ex-Socialist MSP Tommy Sheridan.

Prosecutors allege that Coulson falsely stated that, before the arrest of private investigator Glenn Mulcaire and News of the World journalist Clive Goodman in 2006, he did not know that Mr Goodman was involved in phone hacking with Mr Mulcaire. He denies the charges.

Mr Weatherup, who was giving evidence on the seventh day of the trial, told the court he was appointed to the post of news editor in 2004 when Coulson was the editor.

The witness pleaded guilty to a charge of phone hacking in 2013 and was given a suspended sentence of four months, the court heard.

Mr Weatherup told the court that, a few days into his new role at the paper, he was asked to cut its budget and began to question a payment made to Mr Mulcaire's company, Nine Consultancy.

The salary was about £92,000 - more than the reporters were paid, the witness told the court.

Asked by advocate depute Richard Goddard, prosecuting, if he inquired who was getting the money, he replied: "I was told it was a private investigator called Glenn Mulcaire and I had to work with him."

He said managing editor Stuart Kuttner made the comment to him.

On the payment to the consultancy, which Mr Weatherup described as a "huge sum", he said: "I didn't see the point of having a private investigator being paid full-time for things.

"If you needed things done I thought it would be better and cheaper to be done ad hoc."

The witness said he later raised the issue with Coulson in his office and told him "we didn't need Glenn Mulcaire on the payroll".

Mr Weatherup said Coulson told him to "see Stuart". The witness insisted "there was no appetite to get rid of him (Mulcaire)" by senior management.

Mr Weatherup said he himself was not aware initially but soon found out that Mr Mulcaire "was a phone hacker" and had used his services 137 times, but not all for phone hacking.

Mr Goddard asked Mr Weatherup: "From what you yourself witnessed, did Mr Coulson appear to be aware or not that Mr Mulcaire was hacking phones?"

"Hacking phones was systematic at the News of the World," he replied.

"Did Mr Coulson appear or not to know that Mr Mulcaire was hacking phones?"

"Andy would have known that Mulcaire was hacking phones," the witness replied.

Mr Weatherup said he used a "signal" on two or three occasions in the paper's news conferences to indicate to Coulson that information for a story had come from "phone-hacking activities".

He demonstrated the gesture in court by holding his hand up to the left side of his face.

On one occasion, Mr Weatherup told the jury: "Another executive in conference, when Andy asked the provenance of the story, piped up 'It's the dark arts, boss'."

Coulson told the executive "not to use that language any more", the court heard.

Asked by the prosecutor whether Coulson was joking or serious at the time, Mr Weatherup replied: "He wasn't joking."

Murdo Macleod QC, defending, asked the witness if Mr Mulcaire was on the payroll.

"As Nine Consultancy," he replied.

Pressed on the matter again, Mr Weatherup said: "The name Glenn Mulcaire was not on the payroll but his company Nine Consultancy was, and that was Glenn Mulcaire. It amounts to the same thing."

Mr Macleod asked the witness during his cross-examination how sure he was of his recollection of the conversation he claimed took place in Mr Coulson's office. Mr Weatherup said: "100%."

"Can I suggest to you that this is just nonsense on your part? You're making this up. Are you making this up?" said Mr Macleod.

"Well, I have got no reason to lie. In fact, I feel sorry for Andy, I feel sorry for his wife, I feel sorry for his children. I have no reason to lie," he replied.

Asked later by Mr Goddard how he felt about the suggestion that he was not telling the truth, Mr Weatherup replied: "I have only got one thing to say to that, and it is that it is a gross slur on my character, it's not true.

"I've not come here to lie. I've just come here to tell the truth, reluctantly. I don't want to be here. I don't want to be giving evidence. I want to get over all of this, but it keeps coming back to haunt me."