CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Intermediate:
test existance of!!!! im dying aahhhh



Dec 8, 2002, 6:26 PM

Post #1 of 2 (366 views)
test existance of!!!! im dying aahhhh Can't Post

Crazyim jigged

i need help

cansomeone tell me how to test if a file exists ( in the same direstory as th perl script), if it does, print off some html, if it doesn't, print off soem different html.

ive already got as far as storing the filename im after in the varyable $file_01 but thats all, everything else ive tries to de just screws up... ahhhh....Crazy

Thaumaturge / Moderator

Dec 9, 2002, 12:53 AM

Post #2 of 2 (362 views)
Re: [fridge] test existance of!!!! im dying aahhhh [In reply to] Can't Post

if (-e $file_01) { 
# file exists - do something
} else {
# file doesn't exist - do something else

See perldoc -f -X for more details.

Dave Cross, Perl Hacker, Trainer and Writer
Get more help at Perl Monks


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives