Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8215679
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T11:51:55+00:00 2026-06-07T11:51:55+00:00

I am using perl v14 on windows. I have 2 simple files: $SIG{‘INT’} =

  • 0

I am using perl v14 on windows. I have 2 simple files:

$SIG{'INT'} = sub {
                print "got SIGINT\n";
                                    #some useful code to be executed
                                    #on reception of signal
};

$SIG{'ALRM'} = sub {
                print "got SIGALRM\n";
};
print "my pid: ",$$,"\n";
while(1)
{
    print "part 1\n";
    sleep(3);
    print "part 2\n\n";
    sleep(3);
}

the above file starts and waits to be killed having given its pid.
The second file simply kills the first perl process using its pid(set manually).

$pid = xxxx;  #this is the manually entered pid for I process
print "will attempt to kill process: $pid\n";
kill INT, $pid;

What I run the first perl script and press Ctrl-C, the handler works as expected but using the second file I can’t get the same result. I have also tried with other signals like ALRM,HUP,TERM,FPE but no success. All I want to do is to execute the code in the signal handler.

I found something called INT2 signal for win32.

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T11:51:57+00:00Added an answer on June 7, 2026 at 11:51 am

    Windows does let you use signals only within the same thread. So signaling different processes will not work.

    Instead of signals you could use other methods of interprocess communication like sockets, pipes or files.

    From perlwin32:

    Signal handling may not behave as on Unix platforms (where it doesn’t
    exactly “behave”, either :). For instance, calling die() or exit()
    from signal handlers will cause an exception, since most
    implementations of signal() on Windows are severely crippled. Thus,
    signals may work only for simple things like setting a flag variable
    in the handler. Using signals under this port should currently be
    considered unsupported.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using Perl to read UTF-16LE files in Windows 7. If I read
Using Perl, how do I check if a particular Windows process is running or
Compare using perl -w -Mstrict : # case Alpha print $c; ... # case
trying to automate using perl scripts on windows server using MediaWiki::Bot and Mediawiki::API taken
I am using Perl to do text processing with regex. I have no control
Using perl 5.8.8 on windows server I am writing a perl cgi script using
I am using Perl to print some data read from one file to another.
We have been using Perl's Net:Twitter CPAN module (version 3.12) and basic authentication (not
I am using perl ithreads and things work fine, unless I decide to have
Duplicate data removal using Perl called within via a batch file within Windows A

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.