Oh god. I'm digging through what might be on the order of.a hundred thousand 
lines of perl code on a system.  The file that snippet came from is over ten 
thousand lines long. My brain is about to implode.
 
Thanks.

-----Original message-----
From: Ben Tilly <bti...@gmail.com>
To: Greg London <em...@greglondon.com>
Cc: boston-pm@mail.pm.org
Sent: Tue, Sep 28, 2010 00:29:52 GMT+00:00
Subject: Re: [Boston.pm] $#{$Queue}

Check perlvar.  It is the index of the last array element, which is
one less than the size.

@$Queue will give you the size in scalar context.

On Mon, Sep 27, 2010 at 5:28 PM, Greg London <em...@greglondon.com> wrote:
>
>
> what the heck?
>
> my $Queue = \...@somearray;
>
> if ($#{$Queue} <= -1){
>  # do something
> }
>
> I thought $# was size,
> but the code is checking for it to be minus one?
>
> --
>
>
>
> _______________________________________________
> Boston-pm mailing list
> Boston-pm@mail.pm.org
> http://mail.pm.org/mailman/listinfo/boston-pm
>

_______________________________________________
Boston-pm mailing list
Boston-pm@mail.pm.org
http://mail.pm.org/mailman/listinfo/boston-pm

Reply via email to