http://qs321.pair.com?node_id=11102137


in reply to Re: Refactoring just to refactor?
in thread Refactoring just to refactor?

Wow! I didn't mean for this thread to rewrite that sub, it was just an example. 8)

This is how I write subroutines.

sub name { my $parameter = shift; # or # my ($parameter1, parameter2) = @_; my $end_variable; # ... code to munge the parameter(s) and set end variable... return $end_variable; # or # print $end_variable; }

I do not know why I added .+ to the end of the regex. It doesn't even need the ., the ^[A-Z] would do just as well. I may have been writing other regexen where I needed to search whole strings when I wrote that one.

Many Monks have tried to get me to use various "template" modules. None of them have made any sense to me, even when I tried to use them, they have all lead me to pits of despair. I rolled my own modules for generating HTML for my site that make sense to me. The refactoring for my site for some template module would take months to rewrite. My home rolled template and HTML generation modules are loathed my most, if not all, Monks, but they are what I am comfortable using. I have used them both heavily. I am sure you have seen others banging their heads against that wall before. I try to not bring them up. If you look and then want to yell at me about them, you can open an issue on GitHub to keep it away from here. Too much drama surrounds them already.

Thank you for the tips!

No matter how hysterical I get, my problems are not time sensitive. So, relax, have a cookie, and a very nice day!
Lady Aleena