Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
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?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (16)
As of 2014-12-22 13:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (118 votes), past polls