Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
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 wandering the Monastery: (9)
As of 2015-07-07 01:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (86 votes), past polls