Keep It Simple, Stupid | |
PerlMonks |
Re^2: Surprised by repetition (x) operator applied to a listby Athanasius (Archbishop) |
on Mar 30, 2014 at 03:55 UTC ( [id://1080265]=note: print w/replies, xml ) | Need Help?? |
One way to demonstrate the difference is to replace the expression [@list] with an equivalent subroutine call:
output:
— which confirms that with map the sub is called three times, but with x it is called only once. Hope that helps,
In Section
Seekers of Perl Wisdom
|
|