develooper Front page | perl.perl5.porters | Postings from April 2006

[perl #38920] Filter::Simple error messages getting mangled inside require

Nicholas Clark
April 14, 2006 12:54
[perl #38920] Filter::Simple error messages getting mangled inside require
Message ID:
# New Ticket Created by  Nicholas Clark 
# Please include the string:  [perl #38920]
# in the subject line of all future correspondence about this issue. 
# <URL: >

This is a bug report for perl from,
generated with the help of perlbug 1.35 running under perl 5.9.4.

[Please enter your report here]

Not sure if this is a Filter::Simple bug, or a more general core bug.
Given my module:

package Shout;

use Filter::Simple;

FILTER_ONLY (string => sub { $_ =~ tr/a-z/A-Z/; });


then if I try to feed a perl script through it that it converts to erroneous
perl, I see a sensible error message:

$ cat 
use Shout;

print "Oi!\n";
$ perl 
Missing braces on \N{} at line 3, within string
Execution of aborted due to compilation errors.

which is what I expect.

However, if that same code is in a module:

$ cat 
use Shout;

print "Oi!\n";

$ perl -e 'use Filter'
No quotelike operator found after prefix at ";
...", detected at offset 18Missing braces on \N{} at line 3, within string
Compilation failed in require at -e line 1.
BEGIN failed--compilation aborted at -e line 1.

It all gets mangled. The mangling seems wrong.
IIRC Robin and I found something similar while looking at, while
he was starting out on his switch patch. Something to do with calling die
a second time, and therefore it rethrows $@. But I'm not certain of this.

Nicholas Clark

[Please do not change anything below this line]
Site configuration information for perl 5.9.4:

Configured by nick at Fri Apr 14 17:24:09 BST 2006.

Summary of my perl5 (revision 5 version 9 subversion 4) configuration:
    osname=freebsd, osvers=5.3-release-p28, archname=i386-freebsd-thread-multi
    uname='freebsd 5.3-release-p28 freebsd 5.3-release-p28 #0: wed mar 29 21:59:21 bst 2006 i386 '
    config_args='-Dusedevel=y -Dcc=ccache gcc -Dld=gcc -Ubincompat5005 -Uinstallusrbinperl -Dinc_version_list=  -Dinc_version_list_init=0 -Doptimize=-g -Dusethreads -Uuse64bitint -Uusemymalloc -Duseperlio -Dprefix=~/Sandpit/snap5.9.x-27802 -Dinstallman1dir=none -Dinstallman3dir=none -de'
    hint=recommended, useposix=true, d_sigaction=define
    useithreads=define, usemultiplicity=define
    useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
    use64bitint=undef, use64bitall=undef, uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
    cc='ccache gcc', ccflags ='-DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -DDEBUGGING -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include',
    cppflags='-DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -DDEBUGGING -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include'
    ccversion='', gccversion='3.4.2 [FreeBSD] 20040728', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
    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, prototype=define
  Linker and Libraries:
    ld='gcc', ldflags ='-Wl,-E  -L/usr/local/lib'
    libpth=/usr/lib /usr/local/lib
    libs=-lm -lcrypt -lutil -lc_r
    perllibs=-lm -lcrypt -lutil -lc_r
    libc=, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
    cccdlflags='-DPIC -fPIC', lddlflags='-shared  -L/usr/local/lib'

Locally applied patches:

@INC for perl 5.9.4:

Environment for perl 5.9.4:
    LANG (unset)
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PERL_BADLANG (unset)
    SHELL=/usr/local/bin/bash Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About