Re: Math error in Perl

2003-09-04 Thread John Peacock
Carl Friedberg wrote: Mark, I can explain number 1 by precedence and the results from number 2, which, however I can not explain, nor understand. Here's a simpler example of number 2: $ perl -e "print (2)*5;" 2 Does this make it easier to see? $ perl -we 'print print (2)*5;' print (...) interprete

RE: Math error in Perl

2003-09-04 Thread Craig A. Berry
At 6:31 PM -0400 9/4/03, Carl Friedberg wrote: >Mark, I can explain number 1 by precedence and the results from number >2, which, however I can not explain, nor understand. Here's a simpler >example of number 2: > >$ perl -e "print (2)*5;" >2 I think John's explanation applies here as well. With

RE: Math error in Perl

2003-09-04 Thread Carl Friedberg
Mark, I can explain number 1 by precedence and the results from number 2, which, however I can not explain, nor understand. Here's a simpler example of number 2: $ perl -e "print (2)*5;" 2 Huh? Parens turn this into a list operator or something? Dan, or someone, help! Carl > -Original Messa

Re: Math error in Perl

2003-09-04 Thread John Peacock
Mark Berryman wrote: Could someone please explain to me why only the last two expressions return correct results? $ perl -e "print (212-32)*5/9;" 180 $ perl -e "print (212-32)*5;" 180 $ perl -e "print (212-32);" 180 $ perl -e "print 5*(212-32)/9;" 100 There was just a long discussion on perl5porte