At 09:33 PM 1/8/02 +0530, Prahlad Vaidyanathan wrote:
>Hi,
>
>Is there a perl equivalent of the 'trap' command in bash ? The reason I
>ask is, I create a temporary file at the start of a script, and I want
>to ensure that that temporary file gets removed in case the user hits
>C-c before the script finishes running.

$SIG{INT} = sub { unlink $tempfile };

"perldoc perlvar" and scroll down to the section on %SIG.

--
Peter Scott
Pacific Systems Design Technologies
http://www.perldebugged.com


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to