title: Perl on Linux: change locale for subprocesses
body: <p>What is the correct way to change the locale for a subprocess (in Linux)?</p>
  <p>Example, when running</p>
  <pre><code>perl -e 'use POSIX qw(setlocale); setlocale(POSIX::LC_ALL, &quot;C&quot;); open F, &quot;locale|&quot;; while (&lt;F&gt;) { print if /LC_MESS/ }; close F'
  </code></pre>
  <p>I get the answer <code>LC_MESSAGES=&quot;ca_ES.UTF-8&quot;</code> but I would like to obtain <code>LC_MESSAGES=&quot;C&quot;</code>. Whatever I've tried I can't seem to change it.</p>
  <p>Note: I know about doing <code>LC_ALL=C perl .....</code> but this is <strong>not</strong> what I want todo, I neet to <strong>change the locale inside the Perl script</strong>.</p>