Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Re: Refactoring Perl 1 - Extract Method

by Arunbear (Prior)
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

Replies are listed 'Best First'.
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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://622915]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2018-03-21 09:46 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (265 votes). Check out past polls.