- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- captive perl menu - trap user keystrokes
Operating System - HP-UX
1755690
Members
2774
Online
108837
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-13-2005 08:03 AM
тАО04-13-2005 08:03 AM
Hi all:
Got Perl 5.8.3 on HPUX 11x systems. I have made a type of menu program for the helpdesk personnel. Question, I want this menu to be captive (it is) but I also want to prevent users from breaking out of the menu.
What are the traps? How do I define them?
Many thanks!
Got Perl 5.8.3 on HPUX 11x systems. I have made a type of menu program for the helpdesk personnel. Question, I want this menu to be captive (it is) but I also want to prevent users from breaking out of the menu.
What are the traps? How do I define them?
Many thanks!
Solved! Go to Solution.
- Tags:
- Perl
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-13-2005 08:15 AM
тАО04-13-2005 08:15 AM
Solution
Signal handlers (traps) in Perl are done almost exactly the way they are done in C.
#!/usr/bin/perl
my $Flag = 0; # we'll set this guy in a 'trap'
sub inttrap
{
$Flag = 1;
return(-1);
} # inttrap
$SIG{INT} = \&inttrap; # associate a signal with a subroutine
# Now for an extremely simple read statement.
my $s =;
print "Flag = ${Flag}\n"
Examine the value displayed when you do and don't press the intr key.
#!/usr/bin/perl
my $Flag = 0; # we'll set this guy in a 'trap'
sub inttrap
{
$Flag = 1;
return(-1);
} # inttrap
$SIG{INT} = \&inttrap; # associate a signal with a subroutine
# Now for an extremely simple read statement.
my $s =
print "Flag = ${Flag}\n"
Examine the value displayed when you do and don't press the intr key.
If it ain't broke, I can fix that.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-13-2005 08:18 AM
тАО04-13-2005 08:18 AM
Re: captive perl menu - trap user keystrokes
I should also mention (since this is probably what you want to do) that it's also very easy to ignore signals.
$SIG{INT} = 'IGNORE';
$SIG{HUP} = 'IGNORE';
$SIG{INT} = 'IGNORE';
$SIG{HUP} = 'IGNORE';
If it ain't broke, I can fix that.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-13-2005 08:23 AM
тАО04-13-2005 08:23 AM
Re: captive perl menu - trap user keystrokes
many thanks!
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP