in reply to Re: Do-nothing loops
in thread Do-nothing loops

This might be better:

if (defined(@file)) #your stuff here };

Replies are listed 'Best First'.
Re: Re: Re: Do-nothing loops
by Juerd (Abbot) on Mar 16, 2002 at 09:46 UTC

    if (defined(@file))

    my @foo = (); print defined(@foo) ? "Empty arrays are defined\n" : "Empty arrays are + undefined\n"

    U28geW91IGNhbiBhbGwgcm90MTMgY
    W5kIHBhY2soKS4gQnV0IGRvIHlvdS
    ByZWNvZ25pc2UgQmFzZTY0IHdoZW4
    geW91IHNlZSBpdD8gIC0tIEp1ZXJk
    

      I'm a bit confused by your post. Running your code, it prints "Empty arrays are undefined", as it should...
        5.6.1 gives me this (when warnings are turned on)
        defined(@array) is deprecated at ./emptydefined.pl line 5. (Maybe you should just omit the defined()?) Empty arrays are undefined
        However, 5.00503 does not trigger this warning.

        -Blake