Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

checking if a file exists 2

Status
Not open for further replies.

simanek

Programmer
Jan 19, 2001
137
US
Hi all,

I want to check whether a file exists and want to avoid doing a direct system call. Does anyone know how I'd go about doing this? Thanks much. Mike
~~~~
simanek@uiuc.edu
"It's a Swingline!"
~~~~
 
if(-e $myfile) {}

there are several others including:

-r [readable]
-w [writeable]
-f [a standard file]
-d [a standard directory]

HTH,
Barbie. Leader of Birmingham Perl Mongers
 
You'll find all the above flags at the beginning of the perlfunc manpage.

greadey
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top