zdm has asked for the wisdom of the Perl Monks concerning the following question:
Does anybody can explain why "require BB;" in 1.pl don't work in this case:
--------------------------------- file 1.pl--------------------------------- file AA.pm#!/usr/bin/env perl use 5.18.2; $SIG{__WARN__} = sub { say qq{WARN: $_[0]}; require BB; }; require AA; 1; __END__
--------------------------------- file BB.pmpackage AA; use warnings; a b sub aa { my $self = shift; return $self; } 1; __END__
If I change "a b" in AA.pm to something else, which also generates warning (for example "a b c") - everything works as expected - BB.pm successfully required from $SIG{__WARN__} in 1.pl.package BB; print qq{BB required\n}; 1; __END__
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Unexpected compiler behavior
by Anonymous Monk on Feb 27, 2014 at 01:15 UTC | |
by zdm (Beadle) on Feb 28, 2014 at 13:04 UTC | |
|
Re: Unexpected compiler behavior
by LanX (Saint) on Feb 27, 2014 at 01:10 UTC |