|
-
Mar 12th, 2003, 08:11 PM
#1
Thread Starter
Fanatic Member
Checking if a file exist in Perl? [RESOLVED]
How can I check to see if a file exist on the server using Perl? Is there a function similar to Visual Basic's Dir function?
I know I can use or die to print an error to the server error log but I've yet been able to figure out how to tell my CGI script that the file does not exist.
Thanks!
Last edited by RealisticGraphics; Mar 13th, 2003 at 06:28 PM.
www.RealisticGraphics.net
Running VS.Net Enterprise & VB 6
Other Languages: JavaScript, VBScript, VBA, HTML, CSS, ASP, SQL, XML
MSN Messenger: kmsheff
-
Mar 12th, 2003, 10:18 PM
#2
Member
Code:
if (-e 'filename') {
# file exists
} else {
# file does not exists
}
-
Mar 13th, 2003, 06:28 PM
#3
Thread Starter
Fanatic Member
That worked great! Thanks!
www.RealisticGraphics.net
Running VS.Net Enterprise & VB 6
Other Languages: JavaScript, VBScript, VBA, HTML, CSS, ASP, SQL, XML
MSN Messenger: kmsheff
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|