sub clean_data { my @fields = map { s/\s+/ /g; s/\|/-/g; s/^\s//; s/\s$//; } @_; }