Yenya's World

Fri, 30 Jan 2009

"Too late for -CS" Howto

Speaking on portability: I have recently came across a problem with the newest Perl. We start most of our scripts with the -CS or -CSD switch on the shebang line. Since perl-5.10, this no longer works, it fails with Too late for "-CS" option error message. While I don't understand what has led the Perl developers to this incompatible change, here is the workaround:

The -CS switch can be substituted with the following code at the beginning of the script:

use open ':std', ':utf8';
use open IO => ':bytes';

and the -CSD switch can be replaced with just

use open ':std', ':utf8';

Morale of the story: the most portable languages (and language features) are those which are sufficiently old (which Unicode support in Perl or the STL library in C++ is not). Apart from this problem Perl still seems to be a relatively portable language even for large projects such as IS MU.

Section: /computers (RSS feed) | Permanent link | 3 writebacks

About:

Yenya's World: Linux and beyond - Yenya's blog.

Links:

RSS feed

Jan "Yenya" Kasprzak

The main page of this blog

Categories:

Archive:

Blog roll:

alphabetically :-)