从子例程返回不正确的格式值 [英] Incorrect Format value return from the subroutine

查看:53
本文介绍了从子例程返回不正确的格式值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Perl,我有一个调用两个子程序的主程序(取决于报告名称)。在子程序中,我使用格式变量从CSV文件打印数据,Format_top打印报告标题,STDOUT打印报告数据。这两个子程序都可以单独运行,彼此独立。现在我已将这两个子程序包含在我的主程序中,并根据报告的名称调用这些子程序。这是我的问题:

1.当我运行这个程序时,第一个子程序显示第二个子程序的格式。


2.输出只显示第一个报告和第二个子程序的标题和数据只显示数据,第二个子程序没有显示标题。


任何人都可以帮我这个????

Perl, I have a main program which calls two subroutines (depending upon the report names).In the subroutine I am printing the data from CSV file using the format variable, Format_top prints the report header and STDOUT prints the report data. Both these subroutine runs fine individually, independent of each other. Now I have included both these subroutine in my main program and I call these subroutine depending upon the name of the report. Here is my problem:
1. When I run this program the format of second subroutine is displayed for the first subroutine.

2. Output display only the header and data for the first report and for the second subroutine it displays only data, no header is displayed for the second subroutine.

Can any one help me with this????

推荐答案

我们如何在不看你的代码的情况下提供帮助?
how can we help without seeing your code?


感谢你的回应,我是一个初学者而且不是很熟悉perl。

所以这是我的一个子程序,第二个子程序也很相似,但唯一的区别是它有更多的列。

Thanks for the responce, i am a beginner and not much familier with perl.
So here is my one subroutine and the second subroutine is also similar but the only difference is it has more number of columns.

展开 < span class =codeDivider> | 选择 | Wrap | 行号


任何人都可以帮忙解决这个问题!!!!
Can anybody please help with this!!!!


这篇关于从子例程返回不正确的格式值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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