Badger
view release on metacpan or search on metacpan
lib/Badger/Class.pm view on Meta::CPAN
141814191420142114221423142414251426142714281429143014311432143314341435143614371438Exactly. What we
do
is,
if
we need that extra
push
over the cliff, you know
what we
do
?
my
$amp
= Amplifier->new(
max_volume
=> 11 );
Eleven. Exactly. One louder.
So far, so good. But what
if
we wanted to make this the
default
? Sure, we
could make ten louder and make that be the top number, or we could remember to
we're working
with
temperamental artistes who will be too busy worrying about
the quality of the backstage catering to think about checking their volume
settings
before
they go on stage.
Thankfully we didn't hard-code the maximum volume but used the C<
$MAX_VOLUME
>
package
variable instead. We can change it directly like this:
$Amplifier::MAX_VOLUME
= 11;
Or using the class L<var()> method (just to show you what the roundabout way
looks like):
( run in 0.370 second using v1.01-cache-2.11-cpan-1dc43b0fbd2 )