perl中的新页面 [英] New page in perl

查看:63
本文介绍了perl中的新页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好。我需要创建3个页面。第1页请求用户想要添加和平均的元素数量。第2页询问用户的号码。第3页添加并平均数字并显示它们。我不能创建一个单独的页面3来做到这一点。除了第3页的内容外,第3页还显示了第2页的内容。如何仅将第3页上的内容单独显示?一切正常,所以我只想问怎么做。对于任何反馈,我们都表示感谢。提前致谢。这是我的代码:

Hi. I need to create 3 pages. Page 1 requests the number of elements the user wants to add and average. Page 2 asks the user for the numbers. Page 3 adds and averages the numbers and displays them. I can''t create a separate page 3 to do this. Page 3 shows the contents of page 2 in addition to the contents of page 3. How do I get only the contents on page 3 to display separately? Everything works so I''m just asking how to do this. Any feedback would be appreciated. Thanks in advance. Here is my code:

展开 | 选择 | Wrap | 行号

推荐答案

不进入整个使用范围严格"和警告和CGI模块演讲,并改变你已经拥有的太多代码,这是(我认为)你可以做你想要的一种方式。如有必要,请提出问题。

Without going into the whole use "strict" and "warnings" and the CGI module speech, and changing too much of the code you already have, here is one way how (I think) you can do what you want. Ask questions if necessary.

展开 | 选择 | Wrap | 行号


不,它没有用。它正在做同样的事情。我认为使用隐藏值可能有效,但我猜不是。使用路径信息怎么样?有什么想法吗?


编辑:实际上,现在我更仔细地看一下,第3页上应该分开的文本已经在第2页上显示了。在第2页上单击提交按钮时,将执行数学运算并更新文本以显示总和和平均值。我认为这是在我根据您的建议进行编辑之前发生的。
Nope, it didn''t work. It''s doing the same thing. I thought using hidden values may work, but I guess not. What about using path info? Any thoughts?

Actually, now that I look at it more closely, the text that is supposed to be separate on page3 is already being shown on page2. When the submit button is clicked on page2, the math is performed and the text is updated to show the sum and average. I think this was happening before I edited it with your suggestions as well.


我测试了您的代码和我的代码,但他们没有做同样的事情。我的代码连续显示每个页面,只显示该页面。您的代码显示第一页,然后是第二页,第二页显示第三页输出,第二页输出也显示第三页输出。


我认为这是你想做的事情,你对你所寻求的行为的描述不是很清楚。
I tested your code and my code and they do not do the same thing. My code shows each page in succession, and only that page. Your code shows page one, then page two with page three output displayed in page two, then page three output with page two output also displayed.

I assumed that was what you wanted to do judging by your not very clear description of the behavior you were seeking.


这篇关于perl中的新页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆