[ic] Little puzzle for Perl gurus

interchange-users@icdevgroup.org interchange-users@icdevgroup.org
Tue Sep 17 08:14:02 2002


On Tue, Sep 17, 2002 at 12:44:19PM +0100, marc.brevoort wrote:
> Hello,
> 
> Sorry, this is more of a Perl issue than Interchange, 
> but I'm stumped here. 
> 
> The following gives me the result I expected:
> 
> ##########################################
> sub do_order_action { 
>         my $page="";
> 
>         my ($ordernumber,$orderline,%subref,%CGI)=@_;

    That's risky, better to pass in refs, eg \%subref, \%CGI.
> 
> After swapping the last two subroutine parameters both
> in the sub and the call to it, the function outputs:

That's why.


> 
> Although things seem to work OK in the first version, 
> I think it's a bit creepy to not understand why swapping 
> the parameters makes a difference. What am I missing?


Try ::logGlobal("do_order_action: ("."@_".")");

to see what you are getting.


> 
> Regards,
> 
> Marc Brevoort
> _______________________________________________
> interchange-users mailing list
> interchange-users@icdevgroup.org
> http://www.icdevgroup.org/mailman/listinfo/interchange-users
> 

-- 

Christopher F. Miller, Publisher                               cfm@maine.com
MaineStreet Communications, Inc           208 Portland Road, Gray, ME  04039
1.207.657.5078                                         http://www.maine.com/
Content/site management, online commerce, internet integration, Debian linux