Skip to content

Instantly share code, notes, and snippets.

@dagolden
Last active August 29, 2015 14:17
Show Gist options
  • Save dagolden/84b33f438c639d93158b to your computer and use it in GitHub Desktop.
Save dagolden/84b33f438c639d93158b to your computer and use it in GitHub Desktop.
########### Bar.pm ################
use 5.008001;
use strict;
use warnings;
package Bar;
use warnings::register;
sub hello {
warnings::warnif( "problem" );
print "Hello\n"; # XXX NEVER RUNS
}
1;
########### Foo.pm ################
use 5.008001;
use strict;
use warnings;
package Foo;
use warnings FATAL => 'all';
use Bar;
sub hi { Bar::hello() }
1;
########### Bar.pm ################
#!/usr/bin/env perl
use strict;
use warnings;
use Foo;
Foo::hi();
########### output ################
$ perl foo.pl
problem at Foo.pm line 11.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment