Hi gaochong! I should first note that you've placed a one line separator between each two consecutive lines which makes your message harder to read.
On Wednesday 18 Nov 2009 09:24:44 gaochong wrote: > #!/usr/bin/perl -w > > > > use strict; > use strict and warnings - that's good. > > > $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 . > This is required for portability. From what I recall, on some operating systems, you need to reassign the signal every time it is called. So it's a good practice to include it. Regards, Shlomi Fish -- ----------------------------------------------------------------- Shlomi Fish http://www.shlomifish.org/ Parody on "The Fountainhead" - http://shlom.in/towtf Chuck Norris read the entire English Wikipedia in 24 hours. Twice. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/