good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Others have already pointed you at the appropriate references (which you should now go read), but the basic reason is that this:
is really (for some values of "really") this: It's just that perl allows you to omit the -> bit when you have two adjacent sets of parentheses, braces, or brackets. This phenomenon can be seen be using Deparse: See how the output code is the identical? That means that the input code was parsed identically. (or that you've stumbled onto one of the obscure bugs in Deparse) However, in you test code you don't have two adjacent sets of delimiters, so you aren't allowed to omit the -> bit. Use $func->($param), as other posters have already said.
--
In reply to Re: Quickly changing a function under test in Test::More
by fizbin
|
|