At 05:29 PM 6/29/05 -0400, John Deighan wrote: >use strict; >use constant X => 23; >my $y = X - 2; >print("y = $y\n"); > >To my amazement, it actually printed out "y = 21". So, using the "use >constant" construct actually gave the correct result. In fact, I tried, >just for the heck of it, to change the assignment to "$y = X(-2);" and got >the error message "Too many arguments for main::X at C:\Scripts\test.pl >line 4, near "2)""
I think this has something to do with the prototyping on "functions". With the Posix constant/function it sucked up everything that could be considered an argument to it. An unlimited list. Which is the normal behavior. The use Constant construct on the other hand apparently wants zero arguments and therefore of course will not try to suck up an unlimited list of arguments. Same as if u make a subroutine with a scalar prototype and u try to pass it an array. -- REMEMBER THE WORLD TRADE CENTER ---=< WTC 911 >=-- "...ne cede males" 00000100 _______________________________________________ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs