HMAS Perth took on a pirate ship persona as part of a charity event before embarking on an Indo-Pacific deployment.

On a calm morning in the middle of the Pacific Ocean, Commanding Officer Perth Commander Tony Nagle was ceremoniously marched through a sea of sailors to walk the plank.

'Captain Blackbeard' escorted Commander Nagle to his fate. To the cheers of the crew, the Commander saluted for a final time from the plank's edge then took the plunge into the sea.

He was joined for a swim by the 'mutineers', who celebrated raising more than $10,000 for the Perth-based Pirate Ship Foundation, which researches cures for childhood brain cancer.

Commander Nagle said it was a privilege to walk the plank to raise money for the research, especially given it was a Perth-based charity.

"To support a local charity in the ship's namesake city provides us the opportunity to give back to a community that supports our crew and their families when we're at home and deployed at sea," Commander Nagle said.

"On board we have personal connections to families whose children have succumbed to brain cancer.

"When a family in our community is affected by such a devastating disease, we band together. I am very proud of Perth's efforts to contribute to the research for a cure."

All proceeds are invested in childhood brain cancer research programs, including the Brain Tumour Research Program at Telethon Kids Institute in Perth. Brain cancer kills more children than any other in Australia.

On average, two children are diagnosed with brain cancer every month in Western Australia alone.

The crew were pleased that their contributions go to help create a brighter future for those brave young pirates and their families.

Commander Tony Nagle walks the plank for childhood brain cancer research in a charity event held in the Pacific Ocean.