%SIGã«éã£ãäºã§ã¯ãªãã®ã ããã©ããããã§ã¾ã注æããªãã¦ã¯ãããªãã®ãã%SIGã¯ã°ãã¼ãã«å¤æ°ã§ãããã¨ãããé¢æ°foo()å ã§%SIGãããã£ããã¨ã«returnããã¨ãfoo()ãå¼ã³åºããã¹ã³ã¼ãã§ããã®å¤ã¯æå¹ã«ãªã£ã¦ãã¾ããããã ã¨èªåã¯ããã¦ãä»ã®ã¢ã¸ã¥ã¼ã«çã«å½±é¿ãä¸ããå¯è½æ§ããããããã§ã¾ãçã¨ãã¦local修飾åã使ãçãã¤ãã¦ã»ãã local $SIG{INT} = sub { warn "got SIGINT (OUTSIDE)" }; sub foo { warn "inside foo()"; local $SIG{INT} = sub { warn "got SIGINT (INSIDE foo)" }; sleep 10; } warn "sleeping..."; sleep 10; foo(); warn "outside foo()"; sl
{{#tags}}- {{label}}
{{/tags}}