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

lexical warnings bug?

Thread Previous | Thread Next
From:
Tom Christiansen
Date:
April 4, 2000 08:51
Subject:
lexical warnings bug?
Message ID:
97.954863513@chthon
Is it a bug that I can't use warnings this way down here?
You can't make the local an if 0 and have it still work.
Somehow the warnings are not there.  

    sub compiler {
        my $op    = shift @ARGV || usage();
        *pathedit = eval qq{
            sub () { 
                use warnings qw/FATAL all/;  # XXX: does not work
                local \$SIG{__WARN__} = sub { 
                    local \$_ = "\@_";
                    s/at \\(eval.*//;
                    die "FATAL WARNING: \$_";
                };
                $op;
            }   
        } || do {
            local $_ = $@;
            s/at \(eval.*//s;
            die "$0: can't compile perlexpr $op: $_\n";
        } 
    } 

--tom

Thread Previous | 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