To check if anything exists at given file path use the
print "$anything exists!\n" if -e $in_path;
This is the broad test for also a directory, a named pipe, a symlink.
If you need just a file (preferably with extension, like .txt) you need -f switch. The
-f file test operator asks whether a plain file exists.
print "plain $file exists!\n" if -f $in_path;