in reply to Re^2: Can't get \n or other character/translation escapes to interpolate if originally read from a data file
in thread Can't get \n or other character/translation escapes to interpolate if originally read from a data file

I'm not sure I understand your question.

If you want OS sensitive line breaks in DATA you'll need to translate them.

I'd suggest using plain "enter" in the input and

$output = join "\n", <DATA>

In case of OS problems when reading DATA by line, just adjust $/ before. (Never happened to me *)

> Is that what you mean?

I suggested using HERE-docs instead of DATA. They are per default interpolated.

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery

update

*) actually, this problem can't arise, because Perl reads DATA like it's own code, its the same filehandle. I.e. the script won't run if there where any problems with OS specific line-endings

  • Comment on Re^3: Can't get \n or other character/translation escapes to interpolate if originally read from a data file
  • Select or Download Code