develooper Front page | perl.perl5.porters | Postings from November 1999

[ID 19991118.014] Error producing ^\ (chr 28) with "\c\\"

Thread Next
From:
,,,
Date:
November 18, 1999 23:12
Subject:
[ID 19991118.014] Error producing ^\ (chr 28) with "\c\\"
Message ID:
E11oixE-00039e-00@ficus.frogspace.net
This is a bug report for perl from Philip.Newton@datenrevision.de,
generated with the help of perlbug 1.26 running under perl 5.00503.


-----------------------------------------------------------------
[Please enter your report here]

It appears to be impossible to produce a ^\ character (ASCII 28)
using \c notation. "\x1c" and "\034" work fine, but "\c\\" gives
a two-character string (ASCII 28, 92 i.e. ^\ followed by backslash)
and "\c\" gives "Can't find string terminator '"' anywhere before
EOF".

Examples:

$ perl -wle 'print join ", ", map ord, split //, "\c\"'
Can't find string terminator '"' anywhere before EOF at -e line 1.
$ perl -wle 'print join ", ", map ord, split //, "\c\\"'
28, 92

"\c\\" whould be the correct syntax in my opinion; however, it appears
that the \c logic sees two backslashes -- that the two backslashes
aren't first reduced to one (as per double-quoting usually) before \c
sees it.

[Please do not change anything below this line]
-----------------------------------------------------------------

---
Site configuration information for perl 5.00503:

Configured by frogleg at Sun Aug  8 13:32:51 EDT 1999.

Summary of my perl5 (5.0 patchlevel 5 subversion 3) configuration:
  Platform:
    osname=linux, osvers=5.2, archname=i686-linux
    uname='linux ficus.frogspace.net 2.2.6-ac3 #2 thu aug 5 09:35:04 edt 1999 i686 unknown '
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef useperlio=undef d_sfio=undef
  Compiler:
    cc='gcc', optimize='-O2', gccversion=2.7.2.3
    cppflags='-Dbool=char -DHAS_BOOL -I/usr/local/include'
    ccflags ='-Dbool=char -DHAS_BOOL -I/usr/local/include'
    stdchar='char', d_stdstdio=define, usevfork=false
    intsize=4, longsize=4, ptrsize=4, doublesize=8
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
    alignbytes=4, usemymalloc=n, prototype=define
  Linker and Libraries:
    ld='gcc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib
    libs=-lnsl -lndbm -lgdbm -ldb -ldl -lm -lc -lposix -lcrypt
    libc=, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
    cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'

Locally applied patches:
    

---
@INC for perl 5.00503:
    /usr/local/lib/perl5/5.00503/i686-linux
    /usr/local/lib/perl5/5.00503
    /usr/local/lib/perl5/site_perl/5.005/i686-linux
    /usr/local/lib/perl5/site_perl/5.005
    .

---
Environment for perl 5.00503:
    HOME=/home/newton
    LANG (unset)
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/usr/sbin
    PERL_BADLANG (unset)
    SHELL=/bin/bash

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About