http://www.perlmonks.org?node_id=1010780


in reply to system and -e question

Is there any explanation for that?

One explanation is that $file2 exists, but it wasn't created where you expected and you're looking in the wrong place for it.

You can use File::Spec to determine the absolute path of $file2 - untested:
use File::Spec; use warnings; use strict; my $file2 = 'whatever it is'; my $abs_path = File::Spec->rel2abs($file2); print $abs_path, "\n";
Cheers,
Rob