Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Practical example of "Is Perl code maintainable"

by cLive ;-) (Prior)
on Aug 13, 2007 at 20:22 UTC ( [id://632303]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    sub set_attr {
        # 0 self
    ...
        # 1 attr
        $_[0]->{$_[1]}
    }
    
  2. or download this
    sub set_attr {
        my $self  = shift;
    ...
        my $value = shift;
        $self->{$attr} = $value;
    }
    
  3. or download this
    sub addNums {
        # 0 self
    ...
        # 2 value
        $_[0]->{$_[1]} = $_[2];
    }
    
  4. or download this
    sub capitalize {
        my ($word) = @_;
        $word = "\u$word";
        return $word;
    }
    
  5. or download this
    sub capitalize {
        $_[0]="\u$_[0]";
    }
    
  6. or download this
    $word = captitalize($word);
    
  7. or download this
    captitalize($word);
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (5)
As of 2024-03-29 08:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found