On Sun, Feb 16, 2003 at 11:18:32AM +0000, Benjamin Jeeves wrote:
> 
> Hi
> 
> How would I go about display a message say like "hello and welcome" in a 
> konsole from a perl scripts if some thing meets a pattern that my perl srcipt 
> is look for.  

OK I'm going to post the following in hopes that it will help someone
else help you or give you enough info to run with.  This is just a quick
hack and ugly:)

1) This will check your file for the word HELLO and load an xterm which
   will call another program to display a message.

#!/usr/bin/perl
use strict;
use warnings;

open FILE, 'text.txt';
while (<FILE>) {
    if (/HELLO/) {
        exec("xterm -e /path/to/prog.pl");
    }
}
close FILE;

2) The "prog.pl" opened by the xterm prints a text message and in order to
   stop the xterm from closing I have added a <STDIN> line.  Just hit
   return to close the window.

#!/usr/bin/perl
use strict;
use warnings;

print "You have found HELLO";
my $whatever = <STDIN>;

3) You may want to read /HELLO/ into a scalar in the first bit of code and 
   pass it to "prog.pl" or check for /HELLO/ in text.txt again.  Clunky as 
   I said:)
hth,
kent 

-- 
To know the truth is to distort the Universe.
                      Alfred N. Whitehead (adaptation)

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

Reply via email to