in reply to converting a hash to a string

Why are you using File::IO?

Since you are writing strings, why not
open(F,">outfile") or die; while (($key,$value) = each %seg000) { print F $key , ":" , $value; }
or something like that?