Skip to content

Instantly share code, notes, and snippets.

@andrewrjones
Created March 31, 2014 15:58
Show Gist options
  • Save andrewrjones/9895581 to your computer and use it in GitHub Desktop.
Save andrewrjones/9895581 to your computer and use it in GitHub Desktop.
keep doing something until we catch an INT signal (Ctrl + C)
#!perl
# keep doing something until we catch an INT signal (Ctrl + C)
use strict;
use warnings;
my $running = 1;
$SIG{INT} = sub { $running = 0 };
while($running){
# ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment