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

if (defined(@file))

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

U28geW91IGNhbiBhbGwgcm90MTMgY
W5kIHBhY2soKS4gQnV0IGRvIHlvdS
ByZWNvZ25pc2UgQmFzZTY0IHdoZW4
geW91IHNlZSBpdD8gIC0tIEp1ZXJk

Replies are listed 'Best First'.
Re: Re: Re: Re: Do-nothing loops
by jryan (Vicar) on Mar 17, 2002 at 03:27 UTC
    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