note
xdg
<blockquote><i>Honestly, I'm not convinced $ENV{HOME} should be used on any platform...
</i></blockquote>
<p>If it weren't there already for Unix and Win32 (and MacOS9), I probably wouldn't advocate for it.
</p>
<p>The situation that got me was actually in testing. I'm using a module that uses File::HomeDir to find a config file and I wanted to substitute a new config file in a temporary directory. My quick and dirty approach was just to set <c>$ENV{HOME}</c> to the temporary directory, which turned out to work everywhere except Darwin.</p>
<p>Instead, I'll probably now mock File::HomeDir and override <c>my_home</c> to return the temporary directory.</p>
<div class="pmsig"><div class="pmsig-268515">
<p>-xdg</p>
<p><small><i>Code written by xdg and posted on PerlMonks is [http://creativecommons.org/licenses/publicdomain|public domain]. It is provided <b>as is</b> with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.</i></small></p>
</div></div>
731325
731343