Check FATAL functionality

__END__

# Check compile time warning
use warnings FATAL => 'deprecated' ;
{
    no warnings ;
    1 if $a EQ $b ;
}
1 if $a EQ $b ; 
print STDERR "The End.\n" ;
EXPECT
Use of EQ is deprecated at - line 8.
########

# Check compile time warning
use warnings FATAL => 'all' ;
{
    no warnings ;
    1 if $a EQ $b ;
}
1 if $a EQ $b ; 
print STDERR "The End.\n" ;
EXPECT
Use of EQ is deprecated at - line 8.
########

# Check runtime scope of pragma
use warnings FATAL => 'uninitialized' ;
{
    no warnings ;
    my $b ; chop $b ;
}
my $b ; chop $b ;
print STDERR "The End.\n" ;
EXPECT
Use of uninitialized value in scalar chop at - line 8.
########

# Check runtime scope of pragma
use warnings FATAL => 'all' ;
{
    no warnings ;
    my $b ; chop $b ;
}
my $b ; chop $b ;
print STDERR "The End.\n" ;
EXPECT
Use of uninitialized value in scalar chop at - line 8.
########

# Check runtime scope of pragma
no warnings ;
{
    use warnings FATAL => 'uninitialized' ;
    $a = sub { my $b ; chop $b ; }
}
&$a ;
print STDERR "The End.\n" ;
EXPECT
Use of uninitialized value in scalar chop at - line 6.
########

# Check runtime scope of pragma
no warnings ;
{
    use warnings FATAL => 'all' ;
    $a = sub { my $b ; chop $b ; }
}
&$a ;
print STDERR "The End.\n" ;
EXPECT
Use of uninitialized value in scalar chop at - line 6.
########

--FILE-- abc
1 if $a EQ $b ;
1;
--FILE-- 
use warnings FATAL => 'deprecated' ;
require "./abc";
EXPECT

########

--FILE-- abc
use warnings FATAL => 'deprecated' ;
1;
--FILE-- 
require "./abc";
1 if $a EQ $b ;
EXPECT

########

--FILE-- abc
use warnings 'deprecated' ;
1 if $a EQ $b ;
1;
--FILE-- 
use warnings FATAL => 'uninitialized' ;
require "./abc";
my $a ; chop $a ;
print STDERR "The End.\n" ;
EXPECT
Use of EQ is deprecated at ./abc line 2.
Use of uninitialized value in scalar chop at - line 3.
########

--FILE-- abc.pm
use warnings 'deprecated' ;
1 if $a EQ $b ;
1;
--FILE-- 
use warnings FATAL => 'uninitialized' ;
use abc;
my $a ; chop $a ;
print STDERR "The End.\n" ;
EXPECT
Use of EQ is deprecated at abc.pm line 2.
Use of uninitialized value in scalar chop at - line 3.
########

# Check scope of pragma with eval
no warnings ;
eval {
    use warnings FATAL => 'uninitialized' ;
    my $b ; chop $b ;
}; print STDERR "-- $@" ;
my $b ; chop $b ;
print STDERR "The End.\n" ;
EXPECT
-- Use of uninitialized value in scalar chop at - line 6.
The End.
########

# Check scope of pragma with eval
use warnings FATAL => 'uninitialized' ;
eval {
    my $b ; chop $b ;
}; print STDERR "-- $@" ;
my $b ; chop $b ;
print STDERR "The End.\n" ;
EXPECT
-- Use of uninitialized value in scalar chop at - line 5.
Use of uninitialized value in scalar chop at - line 7.
########

# Check scope of pragma with eval
use warnings FATAL => 'uninitialized' ;
eval {
    no warnings ;
    my $b ; chop $b ;
}; print STDERR $@ ;
my $b ; chop $b ;
print STDERR "The End.\n" ;
EXPECT
Use of uninitialized value in scalar chop at - line 8.
########

# Check scope of pragma with eval
no warnings ;
eval {
    use warnings FATAL => 'deprecated' ;
    1 if $a EQ $b ;
}; print STDERR "-- $@" ;
1 if $a EQ $b ;
print STDERR "The End.\n" ;
EXPECT
Use of EQ is deprecated at - line 6.
########

# Check scope of pragma with eval
use warnings FATAL => 'deprecated' ;
eval {
    1 if $a EQ $b ;
}; print STDERR "-- $@" ;
1 if $a EQ $b ;
print STDERR "The End.\n" ;
EXPECT
Use of EQ is deprecated at - line 5.
########

# Check scope of pragma with eval
use warnings FATAL => 'deprecated' ;
eval {
    no warnings ;
    1 if $a EQ $b ;
}; print STDERR $@ ;
1 if $a EQ $b ;
print STDERR "The End.\n" ;
EXPECT
Use of EQ is deprecated at - line 8.
########

# Check scope of pragma with eval
no warnings ;
eval {
    use warnings FATAL => 'deprecated' ;
}; print STDERR $@ ;
1 if $a EQ $b ;
print STDERR "The End.\n" ;
EXPECT
The End.
########

# Check scope of pragma with eval
no warnings ;
eval q[ 
    use warnings FATAL => 'uninitialized' ;
    my $b ; chop $b ;
]; print STDERR "-- $@";
my $b ; chop $b ;
print STDERR "The End.\n" ;
EXPECT
-- Use of uninitialized value in scalar chop at (eval 1) line 3.
The End.
########

# Check scope of pragma with eval
use warnings FATAL => 'uninitialized' ;
eval '
    my $b ; chop $b ;
'; print STDERR "-- $@" ;
my $b ; chop $b ;
print STDERR "The End.\n" ;
EXPECT
-- Use of uninitialized value in scalar chop at (eval 1) line 2.
Use of uninitialized value in scalar chop at - line 7.
########

# Check scope of pragma with eval
use warnings FATAL => 'uninitialized' ;
eval '
    no warnings ;
    my $b ; chop $b ;
'; print STDERR $@ ;
my $b ; chop $b ;
print STDERR "The End.\n" ;
EXPECT
Use of uninitialized value in scalar chop at - line 8.
########

# Check scope of pragma with eval
no warnings ;
eval q[ 
    use warnings FATAL => 'deprecated' ;
    1 if $a EQ $b ;
]; print STDERR "-- $@";
1 if $a EQ $b ;
print STDERR "The End.\n" ;
EXPECT
-- Use of EQ is deprecated at (eval 1) line 3.
The End.
########

# Check scope of pragma with eval
use warnings FATAL => 'deprecated' ;
eval '
    1 if $a EQ $b ;
'; print STDERR "-- $@";
print STDERR "The End.\n" ;
EXPECT
-- Use of EQ is deprecated at (eval 1) line 2.
The End.
########

# Check scope of pragma with eval
use warnings FATAL => 'deprecated' ;
eval '
    no warnings ;
    1 if $a EQ $b ;
'; print STDERR "-- $@";
1 if $a EQ $b ;
print STDERR "The End.\n" ;
EXPECT
Use of EQ is deprecated at - line 8.
########

use warnings 'void' ;

time ;

{
    use warnings FATAL => qw(void) ;
    length "abc" ;
}

join "", 1,2,3 ;

print "done\n" ;
EXPECT
Useless use of time in void context at - line 4.
Useless use of length in void context at - line 8.
########

use warnings ;

time ;

{
    use warnings FATAL => qw(void) ;
    length "abc" ;
}

join "", 1,2,3 ;

print "done\n" ;
EXPECT
Useless use of time in void context at - line 4.
Useless use of length in void context at - line 8.
