catch_int\catch_hup subroutine
From: DJ (dcercone_at_gmail.com)
Date: 02/25/05
- Next message: John Bokma: "Re: Compare huge XML Files"
- Previous message: Ilya Zakharevich: "Re: A pipe or FH equivalent of LWP::UserAgent ?"
- Next in thread: Brian McCauley: "Re: catch_int\catch_hup subroutine"
- Reply: Brian McCauley: "Re: catch_int\catch_hup subroutine"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 25 Feb 2005 07:51:52 -0800
Has anyone ever used a routine to process signals in a Perl module?
In one of my Perl scripts I have two subroutines defined:
sub catch_hup
sub catch_int
In the main body of my code, I set them up as follows:
$SIG{HUP} = \&catch_hup;
$SIG{INT} = \&catch_int;
This is all defined in the same script file. I would like to move the
subroutine definitions to a Perl module so that I can reuse these
definitions in different Perl scripts. So when I add the two
subroutines (catch_hup and catch_int) into my Module.pm file, I would
like to call them as follows:
$SIG{INT} = Module->catch_hup;
$SIG{HUP} = Module->catch_int;
Is that even possible with Perl? The code that works was inherited and
I have a basic understanding of how it works. Currently I have other
subroutines defined in my Perl module that work fine. However, I'm
sure with signals, it doesn't work the same.
Any help would be appreciated!
Perl rookie!
DJ
- Next message: John Bokma: "Re: Compare huge XML Files"
- Previous message: Ilya Zakharevich: "Re: A pipe or FH equivalent of LWP::UserAgent ?"
- Next in thread: Brian McCauley: "Re: catch_int\catch_hup subroutine"
- Reply: Brian McCauley: "Re: catch_int\catch_hup subroutine"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|