Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Mutator chaining considered harmful

by Aristotle (Chancellor)
on Dec 28, 2004 at 23:09 UTC ( #417872=perlmeditation: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    $frobnitzer->set_frob( 42 )
               ->set_flub( 712 )
               ->set_name( 'veeblefetzer' );
    
  2. or download this
    my $label = $button->border( 20 )->label;
    
  3. or download this
    $window->title( 'foo' )->border( 20 );
    
    # semantically very different from:
    
    $window->child->border( 20 );
    
  4. or download this
    my $label_formatting = $window->title( 'foo' )
                                  ->border( 20 )
                                  ->child->border( 20 )
                                  ->child->font_style;
    
  5. or download this
    $window->title( 'foo' );
    $window->border( 20 );
    ...
    $button->border( 20 );
    
    my $label_formatting = $button->child->font_style;
    
  6. or download this
    $window->set( 
        title => 'foo',
        border => 20,
    );
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlmeditation [id://417872]
Approved by VSarkiss
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (9)
As of 2014-07-25 23:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (175 votes), past polls