$count='000001'; substr($_,0,6)=$count++ for @ordered; [download]
In reply to Re: Sort and Substitution by runrig in thread Sort and Substitution by Anish