Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

System Command and Tk

Status
Not open for further replies.

rbri

Programmer
Jun 27, 2002
84
US
Hello Everyone

I am writing a Perl menu program. My intensions are to have a program that I can execute various flexlm commands from. We have several different vendors that I serve licenses for and I use Macrovisions flexlm stuff to do that. I am attempting to write a menu type program that lists all the vendors I have a license for in a listbox. I have a serious of buttons with various tasks assigned to the buttons, and a text window to display results or output in. The problem I am having is getting the flexlm commands to write to my perl window and not to the term window that my program was started from. I have even tried re-directing the system command to a file and then open and write the file to my text window but nothing goes to the text file when the command is run through perl. If I run the same command from the terminal command line I can get the output info that the flexlm command outputs to go to the text file that is why I thought it would work the same way in perl through the system command but, it doesn't. I did find an example that states a way to get STDOUT to write to a perl window and not to the term window but, I can only get that to work if I use there tail command example. Any help will be greatly appreciated.
 
Curious, are you using system("") or open(D, "flexlm |")?

Michael Libeson
 
I was using system. This is what I typed
system("/0b/flexlm/bin/lmutil lmreread -c (path to license file)");

When that didn't work I added > /tmp/tmpfile.txt to the end of the command hoping it would write the output stuff to that file that didn't work either. I never tried your second option. In that option do you use the D as a file handle?
 
Yes I was using D as the file handle.

open(DATA, "/0b/flexlm/bin/lmutil lmreread -c /path_license_file |") || die "ERR: Unable to run command\n";
@output_data = <DATA>;
close(DATA);


Michael Libeson
 
Thank you very much that works great. It does just what I was trying to do.

Thanks Randy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top