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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hi, I am getting error of Pr 1

Status
Not open for further replies.

ravishanker

Programmer
Oct 8, 2000
14
0
0
IN
Hi,
I am getting error of

Premature end of script
headers: ../ncfs_show/sched_appl_list_form

What is Premature end of Scripts [sig][/sig]
 
Hello ravishanker,

2 possibilities

1 - the Perl is blowing up before it sends enough output to the browser for the browser to figure out what it is recieving.
[tab]Are you sure the Perl is running to completion? Try 'prompt>perl -c program_name'
[tab]to see if the Perl runs.

2 - The Perl is running to completion, but you are printing (sending) non-compliant HTML to the browser. Again, making it impossible for the browser to figure out what is going on.
[tab]If you don't see the problem, try posting a small example of where you think
[tab]the problem might be.

'hope this helps....
[sig]<p> <br><a href=mailto: > </a><br><a href= > </a><br> keep the rudder amid ship and beware the odd typo[/sig]
 
i am unable to run my programs.When i will run my programs through prompt>perl sched_appl_list_form it is giving error as:
Undefined subroutine & main::read_template called at sched_appl_list_form at line 46

BEGIN failed -- Compilation aborted at sched_appl_list_form at line 47

line 46: $sched_appl_list_form::SCHED_APPL_LIST_FORM_TMPLSTR = ::read_template(&quot;sched_appl_list_form&quot;);
line 47: }

Now i will send u full code of above program just tell me what is the error and what i have to do for it.
#!/usr/bin/perl
#!/mnt/hprod05/appln/cert/net/sys/bin/perl
#
# sched_appl_list_form
#
package sched_appl_list_form;
BEGIN {
}
use strict;

my($patch_display_data) = {};
%$patch_display_data = %$::data;

my($testcenter_slot_db_info) = {};
Relation::Testcenter::prepare_testcenter_slot_db_info($testcenter_slot_db_info);

$patch_display_data->{'js_testcenter_slot_db_info'} =
Relation::Testcenter::prepare_js_testcenter_slot_db_info($testcenter_slot_db_info, [ [&quot;&quot;, &quot;&quot;, 0] ], [ [ &quot;All&quot;, &quot; All &quot;] ]);

my($testcenter_code, $testcenter_name) = ([], []);
Relation::Testcenter::get_testcenter_code_name(undef, $testcenter_code, $testcenter_name);

$patch_display_data->{'testcenter_list'} =
::prepare_options([ &quot;All&quot;, @$testcenter_code ],
[ &quot;All&quot;, @$testcenter_name ],
undef, undef, undef);

my($module_code, $module_name) = ([], []);
Relation::Testdef::get_testdef_code_name(undef, $module_code, $module_name);

$patch_display_data->{'module'} = &quot;<SELECT NAME=module>&quot;;
$patch_display_data->{'module'} .=
::prepare_options([ &quot;All&quot; , @$module_code], [ &quot;All&quot; ,
@$module_name], undef, undef, undef);

$patch_display_data->{'module'} .= &quot;</SELECT>&quot;;

$patch_display_data->{'slot_list'} =
::prepare_options([ &quot;All&quot; ], [ &quot; All &quot; ], undef,
undef, undef);

return ::patch_template($sched_appl_list_form::SCHED_APPL_LIST_FORM_TMPLSTR, $patch_display_data);

#------------------------------------------------------------------------

BEGIN {
$sched_appl_list_form::SCHED_APPL_LIST_FORM_TMPLSTR = ::read_template(&quot;sched_appl_list_form&quot;);
}
no strict;


(RaviShanker)



[sig][/sig]
 
Ravi,

Which package is read_template defined in? and prepare_options, and patch_template...

None of them seem to be in this package. [sig][/sig]
 
Hi Guys,
Can u tell me that how u r connecting Oracle 8i
and Perl.u r writing perl programs for storing
the data etc ,So how u r connecting to the
Oracle database.As in Vb/oracle u r doing through
ODBC,in perl how u r connecting to Oracle.
Where u have defining Dsn name,userid,passwd etc
and how u r interfacing both of them.
As r using $dbh,$dbi,$query etc to write the query.
I want 2 know how u r connecting the frontend and backend
i.e Perl with Oracle & how u know that it is storing in the database.

(RaviShanker) [sig][/sig]
 
Hi Ravi,

I use DBI and DBD::Oracle so I'm happy to help with DBI issues but not CGI, as I know nothing about that at all...

First question is: Do you have DBI and DBD::Oracle built for your platform?

You also need Oracle client s/w on that platform (are you able to use sqlplus, or another program that connects to the Oracle DB, on that platform for instance?)

The following info is also available with the command:

perldoc DBI

You should be able to connect to the Oracle test DB (ORCL) with the following statements, as long as $ORACLE_HOME is set (as for all Oracle client s/w):
[tt]
use DBI;

my $dbh = DBI->connect(&quot;dbi:Oracle:ORCL&quot;, &quot;scott&quot;, &quot;tiger&quot;) or die &quot;Can't connect to Oracle DB\n$DBI->errstr\n&quot;;

my $sh = $dbh->prepare('Select * from emp') or die &quot;Can't prepare SQL statement\n$DBI->errstr\n&quot;;

$sh->execute or die &quot;Can't excecute SQL statement\n$DBI->errstr\n&quot;;

my @row;

while(@row = $sh->fetchrow_array){
[tab]print &quot;@row\n&quot;;
}
[/tt]

I hope that this gives you a start. Can I suggest that you do some experimenting with the DBI before you start to integrate it with CGI? [sig]<p>Mike<br><a href=mailto:michael.j.lacey@ntlworld.com>michael.j.lacey@ntlworld.com</a><br><a href= Cargill's Corporate Web Site</a><br>[/sig]
 
about the CGI stuff

Code:
#!/usr/local/bin/perl
use CGI;
$q = new CGI;
print $q->header;
print $q->start_html;
$name = $q->param('name');
print &quot;Name is $name<BR>\n&quot;;
print $q->end_html;

Folding in the DBI/DBD stuff.....

Code:
#!/usr/local/bin/perl
use CGI;
use DBI;

# connect to DB
my $dbh = DBI->connect(&quot;dbi:Oracle:ORCL&quot;, &quot;scott&quot;, &quot;tiger&quot;) or
die &quot;Can't connect to Oracle DB\n$DBI->errstr\n&quot;;

# get employee name from HTML input
$q = new CGI;
print $q->header;
print $q->start_html;
$name = $q->param('name');

my $sh = $dbh->prepare('Select * from emp where name = $name') or 
die &quot;Can't prepare SQL statement\n$DBI->errstr\n&quot;;

$sh->execute or die &quot;Can't excecute SQL
statement\n$DBI->errstr\n&quot;;

my @row;

while(@row = $sh->fetchrow_array)
  {
  print &quot;row returned is \@row<BR>\n&quot;;
  }
print $q->end_html;

Mike, please proof the slight alteration to the db stuff. This is a probably oversimplified treatment. But, I think it will get you a little further through the process. Also, I have not run this, but it should be real close.
[sig]<p> <br><a href=mailto: > </a><br><a href= > </a><br> keep the rudder amid ship and beware the odd typo[/sig]
 
Hi guys,
If i want to find subroutine(e.g read_template,patch_template) defined anywhere in my application directory & in some files.How u can find
read_template etc.As i have got abt 500 files and i don't want to go to prompt>vi filename and see full code line
by line.Just i want like in any txt file etc u r going
to search+find +&quot;type the contents u want to find.Likewise
this i want how u can search read_template,patch_template
etc subroutine from my full programs.And i am using
fire:>vi filename so what i have to do.
Whether i have to use grep etc to search.
So tell me what is the syntax & methods to search read_template etc from full code instead of going line by line from prompt>vi filename.
Reply soon
(Ravi) [sig][/sig]
 
If on a UNIX box....

prompt> find ./ -name &quot;*&quot; -exec grep 'read_template' {} \; -print

This will find all files in the current and lower directories and execute a grep on them looking for the string 'read_template' and then print the resulting file names and the results of the grep.

'hope this helps.... [sig]<p> <br><a href=mailto: > </a><br><a href= > </a><br> keep the rudder amid ship and beware the odd typo[/sig]
 

Hi goBoating (Programmer) ,
Many Many Thanks for my query.
(Ravi)


[sig][/sig]
 
Hi Guys,

I want the code in Perl,Html for: someone please tell me how to find &quot;how many user has logged concurrently at any sites(e.g. i.e loginname,password&quot;. I need this code in order to display all the no of user login at a time .
Also i want to know that which are the web pages he has seen
and how many times.
Thanks in advance [sig][/sig]
 
I'm not sure you can do that....... HTTP does not provide a persistent connection. No one is ever really 'logged' into a web server. The web server knows when a request has been made for some output, but, it does not (might not) know when the user leaves the site. That would be easy enough if you were looking for who was logged onto a UNIX box or into a database.......<thinking> <thinking>..... I'll be interested to see/read if anyone has any ideas....

Sorry. [sig]<p> <br><a href=mailto: > </a><br><a href= > </a><br> keep the rudder amid ship and beware the odd typo[/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top