|
|
|
Clear questions and runnable code get the best and fastest answer |
|
| PerlMonks |
Re^2: Perl Elitist Code vs Functional Codeby tobyink (Monsignor) |
| on Aug 12, 2012 at 07:32 UTC ( #986939=note: print w/ replies, xml ) | Need Help?? |
|
Don't constantly retype boilerplate code. Wrap it in reusable functions. Here's an example for your status/error messages...
An example of usage:
It makes things easier in the long run.
perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||