Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I use perl2exe make *.pl to *.exe(console).
In the D:>perl.exe *.pl form,it can grab ctrl+c
($SIG{'INT'}) then jump to run a subroutine.
But in the *.exe,when I pressed ctrl+c the console window was closed.

I'll give the program to my friend,So I Need Exe.
Can you help me?Thanks.

Replies are listed 'Best First'.
Re: grap ctrl+c when exe
by Adam (Vicar) on Oct 28, 2000 at 22:44 UTC
    I'm impressed you got $SIG{INT} to work in "*.pl form".

    I tried this some time back (Win32 Interrupts) and got your second problem (the thing just exits).
    Some questions: What version/build of Perl are you using (I say build because I assume you are using ActiveState) and what version of Windows are you using? (No *Nix user would have a D: prompt)

Re: grap ctrl+c when exe
by merlyn (Sage) on Oct 28, 2000 at 22:43 UTC
      Unfortunately, this mindset is the downfall of Perl.
      Seriously.
      The leading complaint I hear about Perl is that its unreadable. I show them my code and they drop that complaint.
      Then they complain that I can't easilly distribute it because not everyone has Perl, and it isn't self contained. And all I can do is smile and nod, because they are right. I can't write a simple application in Perl and provide a single, self-sufficient, file to someone else. Granted that complicated projects often involve multiple data files and dlls, but requiring someone to install Perl (and every module I used) just to run a program is rediculous.

      Just my opinion. Downvote if you wish.

        Which begs the question:
        Has anybody written a module that tests for the existence of a module required by the rest of the program, and auto downloads from CPAN and auto installs if not present?

        Malk.
        A reply falls below the community's threshold of quality. You may see it by logging in.
        And if not everyone had the DLLs to make your C binary run, you'd not be able to run that either. That's a silly complaint.

        The proper response to that is "well, it's not a standard install, but it's a trivial install, and it's free."

        -- Randal L. Schwartz, Perl hacker