develooper Front page | perl.perl5.porters | Postings from December 2000

[ID 20001230.005] Documentation error in perlsyn (and PP3ed) re:#line directives

Thread Next
December 30, 2000 15:34
[ID 20001230.005] Documentation error in perlsyn (and PP3ed) re:#line directives
Message ID:
This is a bug report for perl from clintp@budman.backroom,
generated with the help of perlbug 1.26 running under perl 5.006.

[Please enter your report here]

The perlsyn documenation declares that:

       Much like the C preprocessor, Perl can process line
       directives.  Using this, one can control Perl's idea of
       filenames and line numbers in error or warning messages
       (especially for strings that are processed with eval()).
       The syntax for this mechanism is the same as for most C
       preprocessors: it matches the regular expression
       /^#\s*line\s+(\d+)\s*(?:\s"([^"]+)")?\s*$/ with $1 being
       the line number for the next line, and $2 being the
       optional filename (specified within quotes).

The regular expression there is just plain wrong. According to 
toke.c, perl doesn't care about quotes much (except they get
placed into __FILE__ if they're there) and \s isn't quite 
acurate either (' ' and \t are what's looked for).

Programming Perl (3ed) in Chap 24, "Generating Perl in Other
Languages" repeats the error.

[Please do not change anything below this line]

This perlbug was built using Perl 5.00503 - Wed Feb  2 15:34:50 EST 2000
It is being executed now by  Perl 5.006 - Sat Sep  9 11:57:58 EDT 2000.

Site configuration information for perl 5.006:

Configured by clintp at Sat Sep  9 11:57:58 EDT 2000.

Summary of my perl5 (revision 5.0 version 6 subversion 0) configuration:
    osname=linux, osvers=2.2.14-5.0smp, archname=i686-linux
    uname='linux budman 2.2.14-5.0smp #1 smp tue mar 7 21:01:40 est 2000 i686 unknown '
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
    useperlio=undef d_sfio=undef uselargefiles=define 
    use64bitint=undef use64bitall=undef uselongdouble=undef usesocks=undef
    cc='cc', optimize='-O2', gccversion=egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)
    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
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=4, usemymalloc=n, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib
    libs=-lnsl -lndbm -lgdbm -ldb -ldl -lm -lc -lposix -lcrypt
    libc=/lib/, 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.006:

Environment for perl 5.006:
    LANGUAGE (unset)
    LOGDIR (unset)
    PERL_BADLANG (unset)

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About