in reply to Space Out

I might be missing something, but in the comments you talk of renaming, but in the code you use move. This should really only be if used if you know (or the possibility exists) that you might cross file-system boundaries.

Since you appear to be renaming in the same directory, you can get away with the far cheaper rename. It may well be that move is smart enough to know that if this is the case it can fall back to a rename anyway. But I'm not sure, and without going to the effort of consulting the documentation, I can't be certain. Which makes it a losing proposition.

Another minor thing is that

  $file =~ s/\(|\)//g

is better written as

  $file =~ tr/()//d

print@_{sort keys %_},$/if%_=split//,'= & *a?b:e\f/h^h!j+n,o@o;r$s-t%t#u'