With Mac::OSA, you can get the source of the compiled OSA script (such as AppleScript) that you are working with (unless it was saved without the source).
my $desc = OSAGetSource($component, $scriptid, typeChar);
my $source = $desc->get;
But even on Mac OS X, it is returned with Mac newlines, CR, instead of Unix newlines, LF. Even if the input source was with Unix newlines.