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

Re: Deprecating $[

Thread Previous
Chas. Owens
April 2, 2009 12:30
Re: Deprecating $[
Message ID:
On Thu, Apr 2, 2009 at 14:47, David Nicol <> wrote:
> Porting errors and warnings to GNU gettext may be a viable SoC project

I was thinking of something far less serious like

package warnins;

use strict;
use warnings;

my %jokes = (
        '^Use of uninitialized value'      => "Yer usin' a variable
that ain't got a value",
        #FIXME: this probably breaks if the string is '(he said "that sucks")'
        q(^Argument (".*?") isn't numeric) => q(Suffering sukkatash!
Ya used da strin' $1),

$SIG{__WARN__} = sub {
        my $message = join '', @_;

        for my $joke (keys %jokes) {
                last if eval "\$message =~ s/$joke/$jokes{$joke}/";

        warn $message;

sub import {

sub unimport {


Chas. Owens
The most important skill a programmer can have is the ability to read.

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