[Chicago-talk] OPEN() conditional

Richard Reina richard at rushlogistics.com
Thu Jun 30 11:46:55 PDT 2011


I am writing a script that among other things edits a file.  The file can be in one of two places (directories) so if the first open does not work I want it to try the open of the file in the alternative directory.  I know how to do open(F, "</blah/blah") || die or open(F, "</lbal") || warn; but I don't want the program to die but to try another directory.  Is there a way to do open() conditionals or do I need to use readdir first to see if the file exists?

Thanks,

Richard
-- 
Richard Reina
Rush Logistics, Inc.
Watch our 3 minute movie: 
http://www.rushlogistics.com/movie



More information about the Chicago-talk mailing list