Re: what is happening here

2004-04-20 Thread Rob Dixon
Wc -Sx- Jones wrote: [Becuase of a recent discussion on Postfix-users list] Would anyone like to expand/explain what, exactly, is // matching below: #! perl use strict; use warnings; my $idx; while (DATA) { ++$idx; print Line $idx - seen $_ if //; } __DATA__ Line 3 Line 5

RE: what is happening here

2004-04-20 Thread Charles K. Clarkson
WC -Sx- Jones [EMAIL PROTECTED] wrote: : : [Becuase of a recent discussion on Postfix-users list] : Would anyone like to expand/explain what, exactly, is // : matching below: The first iteration of the loop, // matches a zero-length string. Each subsequent time it matches the last

Re: What is happening here

2004-04-09 Thread James Edward Gray II
On Apr 9, 2004, at 3:52 PM, WC -Sx- Jones wrote: # WARNING: This is a very basic question - Maybe only the beginners should answer it? Spoiler Warning! Stop reading here, if you want to solve it yourself... #! perl use strict; use warnings; my ($first, $last, $out) =

Re: What is happening here

2004-03-31 Thread Jeff 'japhy' Pinyan
On Mar 30, R. Joseph Newton said: Jeff 'japhy' Pinyan wrote: The main problem is the PRECEDENCE. Your ? : line is run like so: ((++$count) ? ($count += $count--) : $count) += $count++; Have you tested this? I don't see the precedence issue happening here. Could you try duplicating these

Re: What is happening here

2004-03-30 Thread WC -Sx- Jones
WC -Sx- Jones wrote: What is happening here - while(1) { (++$count) ? $count += $count-- : $count += $count++; :) May I ask a different way? #! /usr/bin/perl use strict; use warnings; my $count; my $str; while(1) { (++$count) ? $count += $count-- : $count += $count++; $str =

Re: What is happening here

2004-03-30 Thread Jeff 'japhy' Pinyan
On Mar 30, WC -Sx- Jones said: my $count; while(1) { (++$count) ? $count += $count-- : $count += $count++; print $count\n; exit if $count 60_000; sleep 1; } The main problem is the PRECEDENCE. Your ? : line is run like so: ((++$count) ? ($count += $count--) : $count) += $count++;

Re: What is happening here

2004-03-30 Thread WC -Sx- Jones
#! /usr/bin/perl use strict; use warnings; my $count; my $index; my $str; while (++$index) { $count = $index; while(1) { (++$count) ? $count += $count-- : $count += $count++; $str = unpack(B32, pack(N, $count)); print $count \tis binary $str\n; last if $count

RE: What is happening here

2004-03-30 Thread Charles K. Clarkson
WC -Sx- Jones [EMAIL PROTECTED] wrote: : : PS - I am admit that I am likely in the middle of : a nervous break-down LOL :) You should be in just the right frame of mind for delving into Parse::RecDecent. :) Charles K. Clarkson -- Mobile Homes Specialist 254 968-8328 -- To unsubscribe,

Re: What is happening here

2004-03-30 Thread R. Joseph Newton
WC -Sx- Jones wrote: WC -Sx- Jones wrote: What is happening here - while(1) { (++$count) ? $count += $count-- : $count += $count++; :) May I ask a different way? #! /usr/bin/perl use strict; use warnings; my $count; my $str; while(1) { (++$count) ? $count += $count--

Re: What is happening here

2004-03-30 Thread R. Joseph Newton
Jeff 'japhy' Pinyan wrote: On Mar 30, WC -Sx- Jones said: my $count; while(1) { (++$count) ? $count += $count-- : $count += $count++; print $count\n; exit if $count 60_000; sleep 1; } The main problem is the PRECEDENCE. Your ? : line is run like so: ((++$count) ?

Re: What is happening here

2004-03-30 Thread Paul Johnson
On Tue, Mar 30, 2004 at 04:57:07PM -0800, R. Joseph Newton wrote: Jeff 'japhy' Pinyan wrote: On Mar 30, WC -Sx- Jones said: my $count; while(1) { (++$count) ? $count += $count-- : $count += $count++; print $count\n; exit if $count 60_000; sleep 1; } The main

RE: What is happening here

2004-03-29 Thread Tim Johnson
Apparently (++$count) evaluates to 0, but I can't figure out why. So the second expression is evaluated first. From there it's pretty self-explanatory. (++$count) will always evaluate to TRUE, since it will only get higher, and the first expression is evaluated. Maybe someone can enlighten

Re: What is happening here

2004-03-29 Thread R. Joseph Newton
Andrew Gaffney wrote: WC -Sx- Jones wrote: What is happening here - #! /usr/bin/perl use strict; use warnings; my $count; while(1) { (++$count) ? $count += $count-- : $count += $count++; print $count\n; exit if $count 60_000; sleep 1; } __END__ -Sx-

Re: What is happening here

2004-03-29 Thread R. Joseph Newton
R. Joseph Newton wrote: Andrew Gaffney wrote: WC -Sx- Jones wrote: What is happening here - That is a damn good question. I'm not sure what results I was expecting when I ran it, but it sure wasn't this: 3 15 63 255 I'm stumped, also.I would have expected progressive

Re: What is happening here

2004-03-29 Thread R. Joseph Newton
Tim Johnson wrote: Apparently (++$count) evaluates to 0, but I can't figure out why. Nope. Always true. It just doesn'yt matter. Bill sorta threw us a red herring here. Seeing the conditiional operator distracts your attention to thinking about the product of the conditional, which is not

Re: What is happening here...?

2001-11-12 Thread John W. Krahn
John W. Krahn wrote: Daniel Falkenberg wrote: Curtis, Cheers for that that makes alot more sense now :). Yes your are correct about the /etc/passwd file. It's all well and good to be able to issue that command from a command line, but what if I wanted to issue the exact same