phasers CONTROL

Documentation for phasers CONTROL assembled from the following types:

language documentation Phasers

From Phasers

(Phasers) phasers CONTROL

Runs when a control exception is raised by the current block, before the LEAVE phase. It is raised by return, fail, redo, next, last, take, warn, proceed and succeed.

say elems gather {
    CONTROL {
        when CX::Warn { say "WARNING!!! $_".resume }
        when CX::Take { say "Don't take my stuff".resume }
    }
    warn 'people take stuff here';
    take 'keys';
}
# OUTPUT: 
# WARNING!!! people take stuff here 
# Don't take my stuff 
# 0