good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
sub()This one was the reason I came here, details are in the Seekers of Perl Wisdom thread. (THANKS again BUU!!!).In short: if you write you're in trouble. Why people do this?Mainly (I think) because it's counter-intuitive to do otherwise. I personally automatically without thinking add "()" to a function declaration. Besides, I call it as "foo()".Another reasons: Perl allows you to do that. What I encountered is, depending on where one calls sush sub, -- before or after it's defInition(!!!), there'll be a syntax error or no errors. (In fact, after fixing my small problem today, I looked closer at my colleague's module and found several dozen subs declared like this. No complaints from Perl). SolutionRead all books, spend several years practicing. I leave to the experts the explanation of what "sub name()" really means (it's an array of subs or smth. like that I guess).-- Find out. In reply to Re^2: Example 1
by Mabooka-Mabooka
|
|