$|=1;
$SIG{INT} = sub { print "tamizh vaazhga\n": };
$SIG{USR1} = sub { print " vennai\n"; };
$SIG{TSTP} = sub { print "poda maanga\n"; };
while(1)
{
print "...";
`sleep 1`;
}
__END__;
try running above, send intterupt like ^c or ^z or USR1.. you can understand..
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 16, 2004 11:57 AM
To: Jayakumar Rajagopal
Cc: [EMAIL PROTECTED]
Subject: RE: traps in perl
thanks for the quick response!
but could you give me an example of what syntax goes in { .... something .... } ;
so
trap { ... example ... } so SIGNAL(s) would be inside the curly braces?
Derek B. Smith
OhioHealth IT
UNIX / TSM / EDM Teams
"Jayakumar Rajagopal" <[EMAIL PROTECTED]>
03/16/2004 10:38 AM
To: <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]>
cc:
Subject: RE: traps in perl
Try :
$SIG{SIGTERM} = sub { ..something..} ; #-- in perl
this is equivalent to trap '... something...' SIGTERM
thanks,
Jay
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 16, 2004 10:29 AM
To: [EMAIL PROTECTED]
Subject: traps in perl
All,
Is there a method or module that allows you to create a trap? For
instance, in ksh or any shell I can create a system trap that will
disallow any keystroke, other than the expected user input specifically
cntrl C, D, \ or U. All of these are mapped to a SIGNAL in
/usr/include/sys/signal.h.
thanks
Derek B. Smith
OhioHealth IT
UNIX / TSM / EDM Teams
614-566-4145