Don't use string eval, especially when you don't need to. Try something like
sub _deprecated { my $sh = shift; require Carp; Carp::carp("$sh() is deprecated; ". "see the documentation for an alternative;"); ... } sub import { ... for (@_){ *{"$pkg\::$_"} = sub { _deprecated($_) }; }

In reply to Re: use deprecated; by Anonymous Monk
in thread use deprecated; by halley

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":