改行コードがおかしいことによるエラー

久々に CGI を書いてサーバにアップしてみると何故か以下のエラーが出て困った話。

CGIWrap Error: Script Execution Failed

CGIWrap encountered an error while attempting to execute this script:

Error Message: No such file or directory
Error Number: 2

This message usually indicates there is a problem with the script itself. Often this indicates either that the #! line of the script is incorrect, or the script was uploaded in binary mode instead of ascii mode. Check to make sure that the script does not have control-M's at the end of every line. That will prevent it from executing. An easy fix that takes care of this most of the time is to put '#!/.../perl --' instead of '#!/.../perl' on the first line of the script.

If you are not the owner of this script, please forward this error and the URL that caused it to the script owner. That is often the component in the URL right after /cgiwrap/.

単純に改行コードがおかしかったのでした。 ははは・・・。

普段は CGI の改行コードを LF で統一している (Windows でも) のですが、今回はたまたま CR + LF で保存しちゃってて問題が起こったのでした。