This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Integrate:
authorAdrian M. Enache <enache@rdslink.ro>
Tue, 26 Aug 2003 08:11:07 +0000 (11:11 +0300)
committerJarkko Hietaniemi <jhi@iki.fi>
Tue, 26 Aug 2003 09:38:57 +0000 (09:38 +0000)
[ 20899]
[perl #23577] fix syscall() prototype description in
perlfunc.pod, as suggested by Lukas Mai.

[ 20900]
More memory lane.

[ 20901]
Subject: Re: [PATCH] valgrind and /#/x
Message-ID: <20030826051107.GA1086@ratsnest.hole>

[ 20902]
CGI::Carp from CGI.pm 3.00 was missing.

[ 20903]
PerlIO on EBCDIC on BS2000 advice from Thomas Dorner.
(This information looks interesting enough to be mentioned
elsewhere, too.)

[ 20904]
No dynaloading at all in Ultrix.

[ 20905]
Take a cutdown version of the change #20903 also to perlebcdic.
p4raw-link: @20905 on //depot/perl: aa2b82fcd287c16c76ad7206bc32889229a2f2ec
p4raw-link: @20904 on //depot/perl: 01757a36693bb5dadd9e763f70e82c02df281ea1
p4raw-link: @20903 on //depot/perl: 756189a56ad5859c77093ea1770647e4355c6aeb
p4raw-link: @20902 on //depot/perl: 0c45d622c9a2e592a5401e1add3c9e8a9170179a
p4raw-link: @20901 on //depot/perl: e994fd663a4d8acc8c717fa28479d849341d1bb4
p4raw-link: @20900 on //depot/perl: 397cf4b72b64bab2d81c27006b39549ca667b5a8
p4raw-link: @20899 on //depot/perl: 5702da47233114a6ad065f7f23d72aab80bc1f11

p4raw-id: //depot/maint-5.8/perl@20906
p4raw-integrated: from //depot/perl@20898 'copy in' README.bs2000
(@15544..) pod/perlebcdic.pod (@17827..) hints/ultrix_4.sh
(@18283..) t/run/fresh_perl.t (@18840..) lib/CGI/Carp.pm
(@19984..) t/op/re_tests (@20538..) 'merge in' toke.c
(@20725..) pod/perlfunc.pod (@20764..) regcomp.c (@20880..)

README.bs2000
hints/ultrix_4.sh
lib/CGI/Carp.pm
pod/perlebcdic.pod
pod/perlfunc.pod
regcomp.c
t/op/re_tests
t/run/fresh_perl.t
toke.c

index 1a0f5b7..a7746c6 100644 (file)
@@ -174,6 +174,40 @@ Perl code:
 Although one would expect the quantities $y and $z to be the same and equal
 to 100000 they will differ and instead will be 0 and 100000 respectively.
 
+=head2 Using PerlIO and different encodings on ASCII and EBCDIC partitions
+
+Since version 5.8 Perl uses the new PerlIO on BS2000.  This enables
+you using different encodings per IO channel.  For example you may use
+
+    use Encode;
+    open($f, ">:encoding(ascii)", "test.ascii");
+    print $f "Hello World!\n";
+    open($f, ">:encoding(posix-bc)", "test.ebcdic");
+    print $f "Hello World!\n";
+    open($f, ">:encoding(latin1)", "test.latin1");
+    print $f "Hello World!\n";
+    open($f, ">:encoding(utf8)", "test.utf8");
+    print $f "Hello World!\n";
+
+to get two files containing "Hello World!\n" in ASCII, EBCDIC, ISO
+Latin-1 (in this example identical to ASCII) respective UTF-EBCDIC (in
+this example identical to normal EBCDIC).  See the documentation of
+Encode::PerlIO for details.
+
+As the PerlIO layer uses raw IO internally, all this totally ignores
+the type of your filesystem (ASCII or EBCDIC) and the IO_CONVERSION
+environment variable.  If you want to get the old behavior, that the
+BS2000 IO functions determine conversion depending on the filesystem
+PerlIO still is your friend.  You use IO_CONVERSION as usual and tell
+Perl, that it should use the native IO layer:
+
+    export IO_CONVERSION=YES
+    export PERLIO=stdio
+
+Now your IO would be ASCII on ASCII partitions and EBCDIC on EBCDIC
+partitions.  See the documentation of PerlIO (without C<Encode::>!)
+for further posibilities.
+
 =head1 AUTHORS
 
 Thomas Dorner
index cc494cb..74d98ae 100644 (file)
@@ -68,3 +68,10 @@ d_dirnamlen='define'
 # Ultrix can mmap only character devices, not regular files,
 # which is rather useless state of things for Perl.
 d_mmap='undef'
+
+# Configure gets fooled somehow into thinking that Ultrix would have mkstemp.
+d_mkstemp='undef'
+
+# There simply isn't dynaloading in Ultrix.
+usedl='undef'
+
index 8420eb2..b990041 100644 (file)
@@ -440,13 +440,13 @@ and the time and date of the error.
 END
   ;
   my $mod_perl = exists $ENV{MOD_PERL};
-  print STDOUT "Content-type: text/html\n\n" 
-    unless $mod_perl;
 
   warningsToBrowser(1);    # emit warnings before dying
 
   if ($CUSTOM_MSG) {
     if (ref($CUSTOM_MSG) eq 'CODE') {
+      print STDOUT "Content-type: text/html\n\n" 
+        unless $mod_perl;
       &$CUSTOM_MSG($msg); # nicer to perl 5.003 users
       return;
     } else {
@@ -490,7 +490,13 @@ END
       $r->custom_response(500,$mess);
     }
   } else {
-    print STDOUT $mess;
+    if (eval{tell STDOUT}) {
+        print STDOUT $mess;
+    }
+    else {
+        print STDOUT "Content-type: text/html\n\n";
+        print STDOUT $mess;
+    }
   }
 }
 
index 1e96fdb..0305b6b 100644 (file)
@@ -168,6 +168,27 @@ and from Latin-1 code points to EBCDIC code points
 For doing I/O it is suggested that you use the autotranslating features
 of PerlIO, see L<perluniintro>.
 
+Since version 5.8 Perl uses the new PerlIO I/O library.  This enables
+you to use different encodings per IO channel.  For example you may use
+
+    use Encode;
+    open($f, ">:encoding(ascii)", "test.ascii");
+    print $f "Hello World!\n";
+    open($f, ">:encoding(cp37)", "test.ebcdic");
+    print $f "Hello World!\n";
+    open($f, ">:encoding(latin1)", "test.latin1");
+    print $f "Hello World!\n";
+    open($f, ">:encoding(utf8)", "test.utf8");
+    print $f "Hello World!\n";
+
+to get two files containing "Hello World!\n" in ASCII, CP 37 EBCDIC,
+ISO 8859-1 (Latin-1) (in this example identical to ASCII) respective
+UTF-EBCDIC (in this example identical to normal EBCDIC).  See the
+documentation of Encode::PerlIO for details.
+
+As the PerlIO layer uses raw IO (bytes) internally, all this totally
+ignores things like the type of your filesystem (ASCII or EBCDIC).
+
 =head1 SINGLE OCTET TABLES
 
 The following tables list the ASCII and Latin 1 ordered sets including
index b254520..23c7657 100644 (file)
@@ -5535,7 +5535,7 @@ use eval:
 
     $symlink_exists = eval { symlink("",""); 1 };
 
-=item syscall LIST
+=item syscall NUMBER, LIST
 
 Calls the system call specified as the first element of the list,
 passing the remaining elements as arguments to the system call.  If
index 7b2c606..5659f21 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -4267,8 +4267,11 @@ S_nextchar(pTHX_ RExC_state_t *pRExC_state)
     for (;;) {
        if (*RExC_parse == '(' && RExC_parse[1] == '?' &&
                RExC_parse[2] == '#') {
-           while (*RExC_parse && *RExC_parse != ')')
+           while (*RExC_parse != ')') {
+               if (RExC_parse == RExC_end)
+                   FAIL("Sequence (?#... not terminated");
                RExC_parse++;
+           }
            RExC_parse++;
            continue;
        }
@@ -4278,10 +4281,8 @@ S_nextchar(pTHX_ RExC_state_t *pRExC_state)
                continue;
            }
            else if (*RExC_parse == '#') {
-               while (*RExC_parse && *RExC_parse != '\n')
-                   RExC_parse++;
-               if (*RExC_parse)
-                   RExC_parse++;
+               while (RExC_parse < RExC_end)
+                   if (*RExC_parse++ == '\n') break;
                continue;
            }
        }
index b794aea..1bec50b 100644 (file)
@@ -941,3 +941,5 @@ a(b)??      abc     y       <$1>    <>      # undef [perl #16773]
 ^.{2,3}?((?:b|a|r)+?)\1\z      foobarbar       y       $1      bar
 ^(?:f|o|b){2,3}?((?:b|a|r)+?)\1\z      foobarbar       y       $1      bar
 .*a(?!(b|cd)*e).*f     ......abef      n       -       -       # [perl #23030]
+x(?#   x       c       -       Sequence (?#... not terminated
+:x(?#: x       c       -       Sequence (?#... not terminated
index a0f707f..1fd4417 100644 (file)
@@ -349,7 +349,6 @@ print "you die joe!\n" unless "@x" eq 'x y z';
 ########
 /(?{"{"})/     # Check it outside of eval too
 EXPECT
-Sequence (?{...}) not terminated or not {}-balanced at - line 1, within pattern
 Sequence (?{...}) not terminated or not {}-balanced in regex; marked by <-- HERE in m/(?{ <-- HERE "{"})/ at - line 1.
 ########
 /(?{"{"}})/    # Check it outside of eval too
diff --git a/toke.c b/toke.c
index 33ee444..56a9d68 100644 (file)
--- a/toke.c
+++ b/toke.c
@@ -1315,7 +1315,7 @@ S_scan_const(pTHX_ char *start)
           except for the last char, which will be done separately. */
        else if (*s == '(' && PL_lex_inpat && s[1] == '?') {
            if (s[2] == '#') {
-               while (s < send && *s != ')')
+               while (s+1 < send && *s != ')')
                    *d++ = NATIVE_TO_NEED(has_utf8,*s++);
            }
            else if (s[2] == '{' /* This should match regcomp.c */
@@ -1334,10 +1334,8 @@ S_scan_const(pTHX_ char *start)
                        count--;
                    regparse++;
                }
-               if (*regparse != ')') {
+               if (*regparse != ')')
                    regparse--;         /* Leave one char for continuation. */
-                   yyerror("Sequence (?{...}) not terminated or not {}-balanced");
-               }
                while (s < regparse)
                    *d++ = NATIVE_TO_NEED(has_utf8,*s++);
            }