in reply to Short as life itself
You shouldn't use the smoke method without checking for legality in your current location.
use Cigarettes; LEGALCHECK: while ($self->get_location->is_indoors()) { eval { require Legalistic::Crap; }; if ($@) { warn "Watch out for the cops!"; last LEGALCHECK; } if (smoking_is_legal($location)) { last LEGALCHECK; } elsif ($location =~ m/bar|pub|restaurant/) { $self->emigrate(); } elsif ($location =~ m/workplace/) { $self->quit_job(); } elsif ($location =~ m/cancer clinic/) { $self->hide_in_closet(); last LEGALCHECK; } else { $self->go_elsewhere(); } } smoke and die;
|
|---|