in reply to Re: calculator help
in thread calculator help

Actually \n on all operating systems unless you do some work to make ity otherwise. Perl translates "local" line end conventions to \n during file I/O so you don't usually have to worry about it.

Perl is the programming world's equivalent of English

Replies are listed 'Best First'.
Re^3: calculator help
by Laurent_R (Canon) on Jun 03, 2014 at 17:52 UTC
    Thank you for the information, GrandFather, I did not know a conversion was done during I/O, I thought that it was chomp that was clever enough to remove "\n" or "\r\n" depending on whether the script was running on Unix or Windows, for example.

    We regularly have issues at work in a different type of situation, when we process files generated by another application running on another system, with end of lines sometimes converted and sometimes not converted during the transfer (FTP in ASCII or bin mode, SFTP, scp, etc.). We then need to pre-process the file before feeding them to our programs (in some cases we even have changed our programs so that they can handle smoothly both cases).

      See PerlIO.

      Perl is the programming world's equivalent of English