There seems to to be a few answers that do a little
more than you asked in your original question.
So I'll try to help with a more minimalist answer (offering my share of TIMTOWTDI):
#!/usr/bin/perl -w
use strict;
my $file = $ARGV[0]||__FILE__;
print "WARNING: $file exists\n" if( -e $file );