Skip to content

Instantly share code, notes, and snippets.

@yaotti
Created May 19, 2010 15:21
Show Gist options
  • Save yaotti/406411 to your computer and use it in GitHub Desktop.
Save yaotti/406411 to your computer and use it in GitHub Desktop.
package debug;
use strict;
use warnings;
use Data::Dumper;
BEGIN {
*CORE::GLOBAL::warn = sub {
my ($package, $file, $line) = caller;
ref $_[0] ? CORE::warn(Data::Dumper::Dumper(@_), sprintf(" at %s line %d\n", $file, $line)): CORE::warn @_, sprintf(" at %s line %d\n", $file, $line);
};}
1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment