Here's something that I'm still confused about.
We have:
print STDOUT : $a;
as indirect object syntax. The colon means "STDOUT is the object we're operating on." It works everywhere. We also have
for 1..10 : 2 {...}
in which the colon indicates a step operation. The above will iterate through the values 2,4,6,8,10.
My question is, how do you you know when : means step and not indirect object?
For example, I would presume
for @a : 2 {...}
means step through @a by twos. But I would expect
foo @a : 2 {...}
to mean indirect object, calling @a.foo(2,{...})
So how's it know?
MikeL
- RE: Array/Colon question Michael Lazzaro
- RE: Array/Colon question Brent Dax
- Re: Array/Colon question Michael Lazzaro
- RE: Array/Colon question Brent Dax
- Re: Array/Colon question Michael Lazzaro