473,388 Members | 1,256 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

Running a process in background and making a GUI

I need to read a log file (real-time) and select only data that I need(filtering) and make a GUI to display the data.

I am getting stuck at the point of being able to process both the log file and the perl script simultaneously. For instance, if I invoke the process(which runs infinitely, since its real-time) in the perl script, the perl script is temporarily suspended. I want the process to run in the background and the perl script to do the necessary filtering etc, and display the required data.

I have been trying to use win32::process to run the process in background. But I am getting some strange errors, with regard to syntax(below is the log of the error). Do we need to have some other plugin/software to run this. I am new to Perl, and this may be a very silly question to some of you, but I have problems running the following script.I am using windows XP cmd to run it.

This is a process to open a notepad, I have not been able to run this.
my $ProcessObj;
Win32::Process::Create($ProcessObj,
'C:\\WINDOWS\\system32\\notepad.exe',
'notepad temp.txt',
0,
NORMAL_PRIORITY_CLASS,
'.') or die $!;


Also, I would like to know if making a GUI (to display some plots of continuous data) is possible in Perl?

Any help would be highly appreciated :)
Thanks a lot!


Expand|Select|Wrap|Line Numbers
  1. Error Log:
  2. ------------
  3. Backslash found where operator expected at C:\Perl\site\bin\testproc.pl line 1,
  4. near "rtf1\"
  5. Backslash found where operator expected at C:\Perl\site\bin\testproc.pl line 1,
  6. near "ansi\"
  7. Backslash found where operator expected at C:\Perl\site\bin\testproc.pl line 1,
  8. near "ansicpg1252\"
  9. Backslash found where operator expected at C:\Perl\site\bin\testproc.pl line 1,
  10. near "deff0\"
  11. Backslash found where operator expected at C:\Perl\site\bin\testproc.pl line 1,
  12. near "f0\"
  13. Backslash found where operator expected at C:\Perl\site\bin\testproc.pl line 1,
  14. near "fmodern\"
  15. Backslash found where operator expected at C:\Perl\site\bin\testproc.pl line 1,
  16. near "fprq1\"
  17. Backslash found where operator expected at C:\Perl\site\bin\testproc.pl line 1,
  18. near "f1\"
  19. Backslash found where operator expected at C:\Perl\site\bin\testproc.pl line 1,
  20. near "fswiss\"
  21. Backslash found where operator expected at C:\Perl\site\bin\testproc.pl line 2,
  22. near "red0\"
  23. Backslash found where operator expected at C:\Perl\site\bin\testproc.pl line 2,
  24. near "green0\"
  25. Bareword found where operator expected at C:\Perl\site\bin\testproc.pl line 3, n
  26. ear "*\generator"
  27.         (Missing operator before generator?)
  28. Backslash found where operator expected at C:\Perl\site\bin\testproc.pl line 3,
  29. near "viewkind4\"
  30. Backslash found where operator expected at C:\Perl\site\bin\testproc.pl line 3,
  31. near "uc1\"
  32. Backslash found where operator expected at C:\Perl\site\bin\testproc.pl line 3,
  33. near "pard\"
  34. Backslash found where operator expected at C:\Perl\site\bin\testproc.pl line 3,
  35. near "cf1\"
  36. Backslash found where operator expected at C:\Perl\site\bin\testproc.pl line 3,
  37. near "f0\"
  38. String found where operator expected at C:\Perl\site\bin\testproc.pl line 5, nea
  39. r "par
  40. 'C:\\\\WINDOWS\\\\system32\\\\notepad.exe'"
  41.         (Missing semicolon on previous line?)
  42. String found where operator expected at C:\Perl\site\bin\testproc.pl line 6, nea
  43. r "par
  44. 'notepad temp.txt'"
  45.         (Missing semicolon on previous line?)
  46. Number found where operator expected at C:\Perl\site\bin\testproc.pl line 7, nea
  47. r "par
  48. 0"
  49.         (Missing semicolon on previous line?)
  50. String found where operator expected at C:\Perl\site\bin\testproc.pl line 9, nea
  51. r "par
  52. '.'"
  53.         (Missing semicolon on previous line?)
  54. Backslash found where operator expected at C:\Perl\site\bin\testproc.pl line 9,
  55. near "cf0\"
  56. Backslash found where operator expected at C:\Perl\site\bin\testproc.pl line 9,
  57. near "f1\"
  58. syntax error at C:\Perl\site\bin\testproc.pl line 1, near "rtf1\"
  59. syntax error at C:\Perl\site\bin\testproc.pl line 1, near "f1\"
  60. syntax error at C:\Perl\site\bin\testproc.pl line 1, near "}}"
  61. syntax error at C:\Perl\site\bin\testproc.pl line 2, near "red0\"
  62. syntax error at C:\Perl\site\bin\testproc.pl line 5, near "par
  63. 'C:\\\\WINDOWS\\\\system32\\\\notepad.exe'"
  64. syntax error at C:\Perl\site\bin\testproc.pl line 9, near "cf0\"
  65. Execution of C:\Perl\site\bin\testproc.pl aborted due to compilation errors.
May 25 '10 #1
3 2404
RonB
589 Expert Mod 512MB
It's impossible for us to troubleshoot your script without seeing it.

Based on your description, I can't fathom why you would need to run notepad.

Yes, Perl can be used to create a gui.

See: perldoc -q "How can I write a GUI"
http://faq.perl.org/perlfaq3.html#How_can_I_write_a_GU
May 25 '10 #2
I was just trying to test running a process(notepad). But it is actually for another process "abc xyz". This is all the script there is:

my $ProcessObj;
Win32::Process::Create($ProcessObj,
'C:\\WINDOWS\\system32\\notepad.exe',
'notepad temp.txt',
0,
NORMAL_PRIORITY_CLASS,
'.') or die $!;



I am not able to run the process even with notepad. Do you know what the reason could be?
May 26 '10 #3
RonB
589 Expert Mod 512MB
Clearly that's not your complete script as you claim. So, unless and until you're willing to be honest and show use your real test code, there's nothing that anyone can do to help you troubleshoot your script.
May 26 '10 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: wesley | last post by:
Hello, How do I pass object to the current running process? For example my assembly is called program.exe. Once program.exe is running sometime I want to call it again ie: program.exe /m...
2
by: Moses M | last post by:
I need to get the the user name associated with a running process (Listed as "UserName" in Task Manager Window). The Process Class doesn't seem to provide a direct way for doing this! Thanks --...
2
by: Steve W | last post by:
Is it possible to keep some communication going between the browser and web server going while waiting for a long running process to finish ? We have one function on our app (ASP.NET / VB.NET)...
7
by: MgGuigg | last post by:
Hello all, This is my first time posting a question to this forum, so here is hoping I am following protocol. I am scraping the rust off my old Basic programming skills, and have just recently...
1
by: peterlan | last post by:
Hello, I have an issue with a long-running import process in our asp.net app (1.1). After the user initiates an import, we're trying to make periodic xmlhttp requests to update a progress bar. In...
5
by: xhy_China | last post by:
How to close an file in an running process from another process? For example: There are two running processes,named procIn and procFrom. A file named needCloseFile was opened in procIn. Now I...
14
by: lmttag | last post by:
Hello. We're developing an ASP.NET 2.0 (C#) application and we're trying to AJAX-enable it. We're having problem with a page not showing the page while a long-running process is executing. So,...
6
by: Kyote | last post by:
I'm trying to make, what I thought, would be a simple application. This application will help me organize files I have a lot of, on my computer(ebooks, pictures, etc..). I'm currently dealing with...
7
by: sravan_reddy001 | last post by:
I want to handle a running process. ex: explorer.exe How can i handle that process(explorer.exe). and is it possilbe to stop that process from runing.
1
by: shekoasinger | last post by:
Im working on a Dll Injector. But that is not my problem. I am using a picturebox to display the icon of a running process. E.g. If google chrome is running. The picturebox should display the icon...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.