简体   繁体   English

使用PerlTray在浏览器中运行Perl

[英]Run Perl in Browser with PerlTray

I am using perl tray from activestate and have a question. 我正在使用来自activestate的perl托盘,并且有一个问题。 I am wanting to make some type of ui or way for a user to set "Settings" on my application. 我想为用户创建某种类型的ui或方法,以在我的应用程序上设置“设置”。 These settings can just be written / read from a text file that is stored on the users computer. 这些设置只能从存储在用户计算机上的文本文件中写入/读取。

The part I am not understanding though is how to go about making a ui. 我不了解的部分是如何制作用户界面。 The only thing i can think of is showing a local perl page that runs on their computer to write to the file. 我唯一想到的是显示一个本地perl页面,该页面在其计算机上运行以写入文件。 However, I'm not sure how i could get perl to run in the browser when only using perltray. 但是,我不确定仅使用perltray时如何使perl在浏览器中运行。

Any suggestions? 有什么建议么?

PerlTray is an odd duck. PerlTray是一只奇怪的鸭子。 It has an implicit event loop that kicks in after you either fall off the end of your program or after your 1st call to exit() . 它有一个隐式事件循环,在您exit()程序末尾或第一次调用exit()之后,该循环将启动。 This makes it incompatible with most other common GUI event loops or most mini-server techniques that operate in the same process & thread. 这使其与大多数其他常见GUI事件循环或在同一进程和线程中运行的大多数小型服务器技术不兼容。

2 possibilities come to mind: 我想到了两种可能性:

  • Most Likely you'll have success spawning a thread or process that creates a traditional perl GUI or a mini-server hosting your configuration web-app. 很可能您会成功产生一个线程或一个进程,该线程或进程创建一个传统的perl GUI或一个托管您的配置Web应用程序的小型服务器。 I'd probably pick Tkx, but that's just my preference. 我可能会选择Tkx,但这只是我的偏爱。

  • I have a suspicion that the Event Loop used by Win32::GUI may actually be compatible with the event loop in PerlTray, but some experimentation would be required to verify that. 我怀疑Win32 :: GUI使用的事件循环实际上可能与PerlTray中的事件循环兼容,但是需要进行一些实验来验证这一点。 I generally avoid Win32::GUI because it's not platform independent, but if you're using PerlTray, you're tied to Windows anyway... 我通常避免使用Win32 :: GUI,因为它不是独立于平台的,但是如果您使用PerlTray,则无论如何您都将与Windows捆绑在一起...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM