I confirmed your result. By placing parens around INT_MAX...

use strict;
use POSIX qw(INT_MAX);

my $i=INT_MAX;
my $n=(INT_MAX) - 1000;

print "$i\n";
print "$n\n";

... the totals appear correctly.

LR

> 
> From: John Deighan <[EMAIL PROTECTED]>
> Date: 2005/06/29 Wed AM 10:04:11 EDT
> To: perl-win32-users@listserv.ActiveState.com
> Subject: mystery
> 
> Can someone tell me what's going on in my script? Here it is:
> 
> use strict;
> use POSIX qw(INT_MAX);
> 
> my $i = INT_MAX;
> my $n = INT_MAX - 1000;
> print("i = $i\n");
> print("n = $n\n");
> 
> 
> It prints out:
> 
> i = 2147483647
> n = 2147483647
> 
> i.e. $i and $n are identical. If I change the second line to:
> 
> my $n = $i - 1000;
> 
> then all is well.
> 
> _______________________________________________
> Perl-Win32-Users mailing list
> Perl-Win32-Users@listserv.ActiveState.com
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
> 

_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to