sub doSomething { my ($var) = @_; print $var; }
Say I have a case where If $var equals a particular value I want it to print in a different way. What's the best way to add this extra functionality cleanly.
To add some perspective I have a large legacy code base that has some nice subs for creating html output but they are littered with little if functions so that the sub does something slightly different if x or y is true.
I can see 2 optionsAny thoughts?
In reply to Best way to handle small changes to subroutines by code4pay
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |