title: Perl::Critic "Don't use this method"-type rule
body: <p>We have been using <a href="https://metacpan.org/module/Perl::Critic" rel="noreferrer"><code>Perl::Critic</code></a> here at work to enforce our code conventions. Recently we ran into issues with <code>/tmp</code> directory getting filled up due to the <code>Temp::File::tempdir</code> function. <code>tempdir</code> cleans up when the Perl process terminates, but since our entire backend is a Perl process, this only occurs when the server itself gets restarted (not very often). We want to encourage developers to use the <code>newdir</code> object method in the future, which cleans up after itself as soon as the object goes out of scope.</p>
  
  <p>Basically, we're trying to mark <code>Temp::File::tempdir</code> as a code convention violation, but I can't seem to find any rule that would be similar on CPAN. I understand that this is hard to enforce in a dynamically-typed language without introducing false positives, but I would expect someone has ran into similar issue in the past with another deprecated function. We're not expecting to catch all the tricky cases either, only the most obvious uses of <code>Temp::File::tempdir</code>. The idea is to discourage accidental use of <code>tempdir</code> when <code>newdir</code> could do the job, not to catch all attempts to fool the critic (developer could always just use <code>## no critic</code>). It would probably be enough to complain when <code>tempdir</code> is used if <code>use Temp::File</code> is defined (preferably checking that nothing else redefines <code>tempdir</code>) and when <code>Temp::File::tempdir</code> is used.</p>
  
  <p>Is there already something similar, or should I start from scratch? Thanks</p>