<p>How do you get Perl to stop and give a stack trace when you reference an undef value, rather than merely warning? It seems that <code>use strict;</code> isn't sufficient for this purpose.</p>

Include this:
```
```
use Carp ();
```
```
Then include
one
of these lines at the top of your source file:
```
```
local $SIG{__WARN__} = \&Carp::confess;
local $SIG{__WARN__} = \&Carp::cluck;
```
```
The
```
confess
```
line will give a stack trace, and the
```
cluck
```
line is much more terse.