Home: Perl Programming Help: Beginner:
error on web page while using perl package



digioleg54
User

Oct 6, 2017, 6:15 AM


Views: 2756
error on web page while using perl package

Hello all,

I have a package, where is a line

Code
our @EXPORT_OK = qw(monthly_rpts rpt_sect_i i_flds df_get_nm df_create df_read_ln);


sub df_create has a line

Code
 open(OUTF,">$df") or die "Failt to create $df"; 
($f_sth=$e_dbh->prepare($QRY_STR)) && ($f_sth->execute());


file is created, but has nothing inside.
However we get an error on web page, instead get something, it displays select query.
Could you please help me to understand where the error is coming from?

Thanks


Laurent_R
Veteran / Moderator

Oct 6, 2017, 8:08 AM


Views: 2747
Re: [digioleg54] error on web page while using perl package

Do you expect something to be in this file? You don't seem to be writing anything to it, so I would expect this file to be created but to remain empty. Or did I miss something?


digioleg54
User

Oct 6, 2017, 8:24 AM


Views: 2746
Re: [Laurent_R] error on web page while using perl package

The problem is not with the file. The problem is that in the package we have a line

Code
our @EXPORT_OK = qw(monthly_rpts rpt_sect_i i_flds df_get_nm df_create df_read_ln);


but I don't see any Perl script, which would use sun df_create . But when I go to web site with trade browser, instead see the real browser with data, I see the query (select ....) and at the end

Code
at /export/applications/dte/perl-lib/ReportTypes/ReportTypesI.pm line 220


this line is in sub df_create where we execute the query. And I don't understand, why this error is here
below is a line 220

Code
($f_sth=$e_dbh->prepare($QRY_STR)) && ($f_sth->execute());


thanks


Laurent_R
Veteran / Moderator

Oct 7, 2017, 3:07 PM


Views: 2714
Re: [digioleg54] error on web page while using perl package

So your problem is, if I understand well, that you have an error on a code line within the df_create sub and that you don't think this sub is called. Is this correct?

Well, since the module you refer to is apparently not a CPAN or otherwise public module but something that you or your organization has created, it is very difficult for us to guess what's in it.

I am afraid we need much more information from you before we can start helping you.