On Wed, 21 Nov 2001, Glenn Cannon wrote:

> Each day is held as a separate file, within a directory for the month.  If
> nothing is happening that day, then there is no file.
>
> How do I go about checking to see if a file exists before attempting to open
> it for reading?

if( -e $filename) {

        open ....
}

See perldoc -f -X for more details on using the file test operator.

-- Brett
                                          http://www.chapelperilous.net/
------------------------------------------------------------------------
Thus spake the master programmer:
        "After three days without programming, life becomes meaningless."
                -- Geoffrey James, "The Tao of Programming"


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to