in reply to Standard way for displaying a script's output.

This looks fine to my eyes; the only objection is the annoying amount of markup required:

# Write results to output file. open my $out_fh, '>', $out_filename or die "Couldn't open $out_filename for writing"; say {$out_fh} $indata; close $out_fh or die "Couldn't close $out_filename";
Output:
XYZ XYZ XYZ XYZ XYZ XYZ xyz foo ATGC atgc JAPHATGC XYZ XYZXYZXYZ

Note that my Display Settings are as shown in Line Numbering in Code Listings.

I'm not the guy you kill, I'm the guy you buy. —Michael Clayton