Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Refactoring Perl #2 - Inline Method

by agianni (Hermit)
on Jun 26, 2007 at 19:10 UTC ( #623470=perlmeditation: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    sub get_rating{
        my $self = shift;
    ...
        my $self = shift;
        return $self->{_number_of_late_deliveries} > 5;
    }
    
  2. or download this
    sub get_rating{
        my $self = shift;
        return ( $self->{_number_of_late_deliveries} > 5 ) ? 2 : 1;
    }
    
  3. or download this
    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: perlmeditation [id://623470]
Approved by Old_Gray_Bear
Front-paged by Old_Gray_Bear
help
Chatterbox?
[ambrus]: `quote
[ambrus]: sorry, typed in the wrong box
[LanX]: Your mother: je ne t'aime plus! ;)
[choroba]: seems lispy
[Your Mother]: Be nice! I speak that much French. Though I also like that song.
[choroba]: So, I joined Pod Černư Vrch some months ago to still have the fun. But I wouldn't call it "punk" anymore...
[LanX]: choroba deaf after one rehearsal per year ?
Discipulus .. per ear!
[LanX]: LOL
[choroba]: we used to play more :)

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (9)
As of 2017-03-24 12:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (301 votes). Check out past polls.