note
dragonchild
If you want to be a bit more thorough, you could do something like
<code>
use File::Spec::Functions( rel2abs canonpath );
my $full_inpath = canonpath( rel2abs( $infile ) );
my $full_outpath = canonpath( rel2abs( $outfile ) );
if ( $full_inpath eq $full_outpath ) { ... }
</code>
Yes, there are ways to fool this. Ideally, there would be some is_same_real_file() in [cpan://File::Spec] that would take into account symlinks, case sensitivity, volume names, and the like.
<!-- Node text goes above. Div tags should contain sig only -->
<div class="pmsig"><div class="pmsig-85580">
<hr>
My criteria for good software:
<ol>
<li>Does it work?
<li>Can someone else come in, make a change, and be reasonably certain no bugs were introduced?
</ol>
</div></div>
488824
489207