Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Refactoring Perl 1 - Extract Method

by Arunbear (Parson)
on Jun 22, 2007 at 21:54 UTC ( #622915=note: print w/ replies, xml ) Need Help??


in reply to Refactoring Perl #1 - Extract Method

Stating the obvious perhaps, but as use of objects/methods is optional in Perl (but not in Java from which you're translating), and having a code fragment that can be grouped together arises whether or not you're writing in OO style, the answer Turn the fragment into a method ... could just as well be Turn the fragment into a subroutine ..., i.e. refactoring in Perl is not limited to object oriented considerations.


Comment on Re: Refactoring Perl 1 - Extract Method
Re^2: Refactoring Perl 1 - Extract Method
by agianni (Hermit) on Jun 25, 2007 at 03:50 UTC

    Absolutely. Many of Fowler's refactoring patterns are specific to OO design, but there are plenty of them that are more generally applicable to most subroutine-driven, imperative programming language. I will try to keep that differentiation in mind as I review future patterns.

    perl -e 'split//,q{john hurl, pest caretaker}and(map{print @_[$_]}(joi +n(q{},map{sprintf(qq{%010u},$_)}(2**2*307*4993,5*101*641*5261,7*59*79 +*36997,13*17*71*45131,3**2*67*89*167*181))=~/\d{2}/g));'

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://622915]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (3)
As of 2015-07-03 23:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (57 votes), past polls