in reply to Re: Sending excel file as an attachment
in thread Sending excel file as an attachment

That still begs the question "Why did the attach method not return an error"?

I had a quick look at the source-code of this method. It calls the build method but that method does not check if the file exists or is accessible. So there is no error checking done here and the usual "or die ..." invocation gives a false sense of security.

CountZero

A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

Replies are listed 'Best First'.
Re^3: Sending excel file as an attachment
by Jenda (Abbot) on Apr 13, 2011 at 11:38 UTC

    It would return an error if the file did not exist at all, but it can hardly know you have it opened somewhere and that there are some data waiting to be written in some buffers or something. Or even that some object holds data that it will write into that file once you tell it to or destroy the object.

    Jenda
    Enoch was right!
    Enjoy the last years of Rome.