in reply to Formating Numbers Preceding 0's

Just for fun:

'0' x (6-length($defectid)).$defectid

Cheers
Chris