No such thing as a small change | |
PerlMonks |
Re^3: Perl is more intuitiveby Joost (Canon) |
on Aug 19, 2005 at 11:57 UTC ( [id://485086]=note: print w/replies, xml ) | Need Help?? |
each is actually a method name that's used for many of the container types; arrays use it too:
Basically, each here is just a method that recieves a block (like perl's anonymous subroutines) as an argument. The container type is then responsible for calling the block for each element. Any class can provide it's own each method - this is not a built-in function like perl's foreach.
In Section
Meditations
|
|