Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
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 avoiding work at the Monastery: (7)
As of 2016-10-01 17:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?






    Results (2 votes). Check out past polls.