On Fri, 29 Jun 2001, Toni Janz wrote:

> I will attatch it to this email so that mayhap you can explain why it
> does what it does.

Please don't send attachments to the list, just include your code int eh
body of the message.  A lot of attachments don't come with the proper MIME
header and can't be directly opened in many browsers (especially
text-based ones like Pine or Mutt).

> Note: the think that I added was the double bang '!!'
> I was previously using things like:
>
> for ($i=0; $b[$i] != undef; $i++)

Here's your problem -- you can't compare something to nothing.  != is only
used for comparing inequality for numbers.  ne is used for strings.  But
in this case, neither will work.  undef is not the same as NULL.  What you
want to do is check to see if the element is defined:

for($i = 0; defined($b[$i]); $i++) {

However, since we are using Perl and not C, we can make this even tidier:

foreach (@b) {  print }

-- Brett
                                   http://www.chapelperilous.net/btfwk/
------------------------------------------------------------------------
May a hundred thousand midgets invade your home singing cheesy lounge-lizard
versions of songs from The Wizard of Oz.

Reply via email to