#!/usr/bin/perl -w

 

use strict;

 

$SIG{INT}=\&stop;

$|=1;

my $count=3;

while ($count) {

        print "hello\n";

        sleep 1;

}

 

sub stop {

        $SIG{INT}=\&stop;   -----------------------------here  why set this
?  if no ,the result is same .

        $count--;

        print "$count\n";

        unless ($count){

                print "sorry,I did not want to stop ...\n";

        }

}

Reply via email to