Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
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 browsing the Monastery: (13)
As of 2014-09-23 18:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (234 votes), past polls