Re: Help understanding VEC

2006-03-27 Thread Jay Savage
On 3/27/06, Chad Perrin <[EMAIL PROTECTED]> wrote: > On Mon, Mar 27, 2006 at 04:17:41PM -0800, John W. Krahn wrote: > > Jay Savage wrote: > > > > > > You might also want to keep in mind that the BITS must be a power of 1 > > > > It must be a power of 2. > > . . . and thus a power of 10. > > Ahem.

RE: Help understanding VEC

2006-03-27 Thread Jim
> Jay Savage wrote: > > > > > > > You might also want to keep in mind that the BITS must be a > power of 1 > It must be a power of 2. > > > from one to 32, and that vec() is lvaluable, but you don't need to > > know that to look at the code here. > > > > vec( $address, 7, 1 ) > >

Re: Help understanding VEC

2006-03-27 Thread Chad Perrin
On Mon, Mar 27, 2006 at 04:17:41PM -0800, John W. Krahn wrote: > Jay Savage wrote: > > > > You might also want to keep in mind that the BITS must be a power of 1 > > It must be a power of 2. . . . and thus a power of 10. Ahem. -- Chad Perrin [ CCD CopyWrite | http://ccd.apotheon.org ] This si

Re: Help understanding VEC

2006-03-27 Thread John W. Krahn
Jay Savage wrote: > > Treats the string in EXPR as a bit vector made up of elements of width > BITS, and returns the value of the element specified by OFFSET as an > unsigned integer. > > You might also want to keep in mind that the BITS must be a power of 1 It must be a power of 2. > from one

Re: Help understanding VEC

2006-03-27 Thread Jay Savage
On 3/27/06, Jim <[EMAIL PROTECTED]> wrote: > > > > > > I am trying to understand how vec() is works in the code below > > > > Have you seen the documentation in the perlfunc manpage? > > > > perldoc -f vec > > > > If you still have questions, after seeing the docs, please ask again. > > Hope th

RE: Help understanding VEC

2006-03-27 Thread Jim
> > > I am trying to understand how vec() is works in the code below > > Have you seen the documentation in the perlfunc manpage? > > perldoc -f vec > > If you still have questions, after seeing the docs, please ask again. > Hope this helps! > Yes, I have read it already. Thanks -- T

Re: Help understanding VEC

2006-03-26 Thread Tom Phoenix
On 3/26/06, Jim <[EMAIL PROTECTED]> wrote: > I am trying to understand how vec() is works in the code below Have you seen the documentation in the perlfunc manpage? perldoc -f vec If you still have questions, after seeing the docs, please ask again. Hope this helps! --Tom Phoenix Stoneheng

Help understanding VEC

2006-03-26 Thread Jim
Hi I am trying to understand how vec() is works in the code below -- my $address = inet_aton( $ARGV[0] ); # ip addr string ... my $class = vec( $address, 7, 1 ) ? vec( $address, 6, 1 ) ? vec( $address, 5, 1 ) ? 'D' : 'C' : 'B' : 'A'; -- I understand that it is testing t