Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Interrupting a script during execution for user help file

Reply
Thread Tools

Interrupting a script during execution for user help file

 
 
daveyand
Guest
Posts: n/a
 
      01-04-2006
Hey Guys,

I've tried to search this group for some help with my problem but i
cant seem to find anything. It could be my search term, not exactly
sure what i'm trying to do is called.

Basically what i've done is create a script that creates a directory
tree and also creates some files based on user input. The idea is that
i will be creating a number of firefox extensions so want the structure
to be the same. A template type thing, as it were. (I know this might
exist already but i'd like to see how i can do it myself, still got
alot of perl to learn).

Anyway....

I'd like to be able to get the script to listen to key presses and when
a user presses H the script will load up a browser with an HTML file,
or at least open up a text document. So the user can look through that
whilst doing their work. I dont have delusions of granduer and i doubt
many people will see my script but still

I know how i can do a simple, do you need help now type situation, and
then do stuff there and then, but thats not really what i want, i want
it always to listen.

Is this infact possible, what other info might you need to understand
what i am doing.

Hope someone can help. Thanks guys.

 
Reply With Quote
 
 
 
 
usenet@DavidFilmer.com
Guest
Posts: n/a
 
      01-05-2006
daveyand wrote:
> I'd like to be able to get the script to listen to key presses and when
> a user presses H the script will load up a browser with an HTML file,


How about something like this:

#!/usr/bin/perl
use strict; use warnings;
use Term::GetKey;
use Proc::Fork;

while ( $_ = qtty() ) {
if (/H/i) {
print "Help is on the way!\n";
child {
exec ("/usr/bin/firefox http://google.com");
}
}
}

__END__

--
http://DavidFilmer.com

 
Reply With Quote
 
 
 
 
Tad McClellan
Guest
Posts: n/a
 
      01-05-2006
daveyand <(E-Mail Removed)> wrote:

> I'd like to be able to get the script to listen to key presses



perldoc -q keyboard

How can I read a single character from a file? From the keyboard?

How do I do fancy stuff with the keyboard/screen/mouse?

How do I check whether input is ready on the keyboard?


--
Tad McClellan SGML consulting
http://www.velocityreviews.com/forums/(E-Mail Removed) Perl programming
Fort Worth, Texas
 
Reply With Quote
 
daveyand
Guest
Posts: n/a
 
      01-05-2006
cheers for the suggestions, will look into them. And jim, the first
section was just the problem that i have. Not a problem in perl The
task. was giving some background knowledge so people wouldnt say erm
why are you doing this.

So in essence you could have ingnored the first thing.

also does anyone know of a good firefox extensions workgroup. Mainlyl
focusing on creating one in FF 1.5+.

Thanks for the help.

 
Reply With Quote
 
Eric Bohlman
Guest
Posts: n/a
 
      01-05-2006
"daveyand" <(E-Mail Removed)> wrote in news:1136456453.057939.91070
@g44g2000cwa.googlegroups.com:

> also does anyone know of a good firefox extensions workgroup. Mainlyl
> focusing on creating one in FF 1.5+.


If you've got access to a well-stocked news server (e.g. individual.net),
check out the various mozilla.public.* groups; they seem to be where most
of the action is.
 
Reply With Quote
 
Dr.Ruud
Guest
Posts: n/a
 
      01-05-2006
daveyand schreef:

> So in essence you could have ingnored the first thing.


For Daveyand and everybody else with "User-Agent: G2/#.#":

"How can I automatically quote the previous message when I post a
reply?"
http://groups.google.co.uk/support/b...y?answer=14213

See also:
http://www.safalra.com/special/googlegroupsreply/

What's good 'netiquette' when posting to Usenet?
http://groups.google.co.uk/support/b...y?answer=12348
http://directory.google.com/Top/Comp...net/Etiquette/

But Google needs you to vote for 'Default quoting of previous message in
replies'
http://groups-beta.google.com/suppor..._type=features

--
Affijn, Ruud

"Gewoon is een tijger."

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Interrupting the evaluation of a ruby script Emmanuel Emmanuel Ruby 11 06-10-2010 05:38 AM
Non-Interrupting Logins kaburke ASP .Net 5 08-18-2005 02:28 PM
Interrupting execution of PyRun_SimpleScript() stephan Python 1 05-01-2005 06:44 AM
JVM Memory leak after interrupting threads?? slubowsky@netzero.net Java 4 01-27-2005 06:13 PM
Switch user during script execution --help-- Oliver Perl 2 02-12-2004 02:16 AM



Advertisments