Created
April 9, 2015 01:59
-
-
Save awwaiid/fc6e88ff1ecd846bc438 to your computer and use it in GitHub Desktop.
Skip to next song or exit
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
my $in_break = False; | |
signal(Signal::SIGINT).tap: { | |
exit if $in_break; | |
$in_break = True; | |
say "Going to next song..."; | |
sleep 5; # Give them a chance to interrupt again | |
$in_break = False; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment