On Friday, October 4, 2002, at 11:21 AM, dan wrote: > or > > if (!$array[0]) {
This tests for a "true" value in the first element of an array, not if it's empty. This test will succeed for the list (undef, 1, 2, "More Data"), which is definitely not empty. > # it's empty > } > > your choice :) > > dan > > "Nikola Janceski" <[EMAIL PROTECTED]> wrote in message > [EMAIL PROTECTED]">news:[EMAIL PROTECTED] > ... >> if(not @array){ >> # it's empty >> } >> >>> -----Original Message----- >>> From: Bryan Harris [mailto:[EMAIL PROTECTED]] >>> Sent: Friday, October 04, 2002 11:58 AM >>> To: Beginners Perl >>> Subject: Check for empty array >>> >>> >>> >>> >>> What's the easiest way to check whether an array is empty? >>> >>> I'm really feeling like a beginner today... >>> >>> - Bryan >>> >>> >>> -- >>> To unsubscribe, e-mail: [EMAIL PROTECTED] >>> For additional commands, e-mail: [EMAIL PROTECTED] >>> >> >> ---------------------------------------------------------------------- >> ---- > -- >> -------------------- >> The views and opinions expressed in this email message are the >> sender's >> own, and do not necessarily represent the views and opinions of Summit >> Systems Inc. >> > > > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]