Help for this page

Select Code to Download


  1. or download this
    $_->salary(    $_->salary() * 1.02 );
    
  2. or download this
    $_->salary *= 1.02 for @employees;
    
  3. or download this
    for (@employees) {
        $_->salary *= 1.02;
        $_->frobnitz += 1.5;
    }
    
  4. or download this
    my $do_operation; # Defined elsewhere, possibly from user input
    my $by_ammount; # Also from user
    ...
    ;
    my $effect = Effect->new( [ salary => $by_ammount, $op ] );
    $_->apply_effect( $effect ) for @employees;
    
  5. or download this
    my $do_operation; # Defined elsewhere, possibly from user input
    my $by_ammount; # Also from user
    ...
        # And so on
    ;
    &$op($_->salary) for @employees;
    
  6. or download this
    my $do_operation; # Defined elsewhere, possibly from user input
    my $by_ammount; # Also from user
    ...
        # And so on
    ;
    eval "\$_->salary $op= \$by_amount" for @employees;
    
  7. or download this
    $reactor->insert_cooling_rods;
    $reactor->shut_down_liquid_cooling;