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 Message-----
> From: Mark Berryman [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, September 04, 2003 5:48 PM
> To: [EMAIL PROTECTED]
> Subject: Math error in Perl
> 
> 
> 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
> 
> Mark Berryman
> 

Reply via email to