[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ic] Stoopid question and offer


Tom Tucker wrote:
> Can anybody tell me why:
> 
>     [calc]($Scratch->{first},$Scratch->{last}) = split(/:\s/, "Tom:
> Tucker");[/calc]
> 
> should output "2" on a page?

Because you have no explicit return, it's returning the last thing it
did -- and it's doing so in a scalar context.  A two element array (in
this case an anonymous one) referred to in a scalar context yields "2".

If you just want to hide it, I suppose you could add "return;" after
your final semicolon.


-John Young
_______________________________________________
interchange-users mailing list
suppressed
http://www.icdevgroup.org/mailman/listinfo/interchange-users


Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.