=item Too late for "-%s" option
(X) The #! line (or local equivalent) in a Perl script contains the
-B<-M>, B<-m> or B<-C> option. This is an error because those options
-are not intended for use inside scripts. Use the C<use> pragma instead.
+B<-M>, B<-m> or B<-C> option.
+
+In the case of B<-M> and B<-m>, this is an error because those options are
+not intended for use inside scripts. Use the C<use> pragma instead.
+
+The B<-C> option only works if it is specified on the command line as well
+(with the same sequence of letters or numbers following). Either specify
+this option on the command line, or, if your system supports it, make your
+script executable and run it directly instead of passing it to perl.
=item Too late to run %s block
This feature was practically unused, however, and the command line
switch was therefore "recycled".)
-B<Note:> Since perl 5.10.0, the -C option can no longer be used
-on the #! line. It wasn't working there anyway, since the standard streams
+B<Note:> Since perl 5.10.1, if the -C option is used on the #! line, it
+must be specified on the command line as well, since the standard streams
are already set up at this point in the execution of the perl interpreter.
-You can use binmode() instead to get the desired behaviour.
+You can also use binmode() to set the encoding of an I/O stream.
=item B<-c>
X<-c>
BEGIN { require "./test.pl"; }
-plan(tests => 6);
+plan(tests => 7);
my $r;
args => [ chr(256) ] );
like( $r, qr/^256(?:\r?\n)?$/s, '-CA: @ARGV' );
+$r = runperl( switches => [ '-CS', '-w' ],
+ prog => "#!perl -CS\nprint chr(256)",
+ stderr => 1, );
+like( $r, qr/^$b(?:\r?\n)?$/s, '#!perl -C' );
const char *d1 = d;
do {
- if (*d1 == 'M' || *d1 == 'm' || *d1 == 'C') {
+ bool baduni = FALSE;
+ if (*d1 == 'C') {
+ const char *d2 = d1;
+ d2++;
+ parse_unicode_opts( (const char **)&d2 )
+ == PL_unicode
+ || (baduni = TRUE);
+ }
+ if (baduni || *d1 == 'M' || *d1 == 'm') {
const char * const m = d1;
while (*d1 && !isSPACE(*d1))
d1++;