How can I have variable assertions in Perl?

assertion, debugging, perl, python

Solution

A quick CPAN search suggests Carp::Assert.

Problem

How can I check that a variable has a specific value in Perl? Is there a command to stop a script's execution to look up some of its variables? I wonder if I can use the Pythonic practice of inserting: ``` assert 0, (foo, bar) ``` to debug scripts in a debuger-less way?

Original source