Other than switching to something more OOish with fewer direct values accesses and more method calls, I fail to see what this example accomplishes.
The cons, though, are clear to me. You're using more vertical space in the editor. You're making more context switches. You're using more overall code, so there are more places for bug to get in (although the code is really simple).
Earlier in this series you posted a node about Fowler saying to replace temporary variables with inline expressions or something similar, didn't you? How's this:
sub get_price{
my $self = shift;
return (
( $self->{_quantity} * $self->{_item_price} ) > 1000
? ( $self->{_quantity} * $self->{_item_price} ) * 0.95
: ( $self->{_quantity} * $self->{_item_price} ) * 0.98
);
}
Of course, that's less legible, more bug prone, and trades one scalar (the memory for which could be reused once this little snippet goes out of scope) for having to recalculate the value twice, but it follows guru advice.
If you just do away with one of the two temps and use a more powerful operator, though:
sub get_price{
my $self = shift;
my $base_price = $self->{_quantity} * $self->{_item_price};
return $base_price *= $self->{_quantity} > 1000 ? 0.95 : 0.98;
}
That seems to me to be about the best compromise. You get rid of half your temporary values, it's still just one method, it's short, it's clear, and it's idiomatic.
Of course, there's still the small matter of three magic numbers, but for the example we can probably overlook that.