×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Hi, I am getting error of Pr

Hi, I am getting error of Pr

Hi, I am getting error of Pr

(OP)
Hi,
   I am getting error of

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

 What is  Premature end of Scripts

RE: Hi, I am getting error of Pr

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.
    Are you sure the Perl is running to completion?  Try 'prompt>perl -c program_name'
    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.
    If you don't see the problem, try posting a small example of where you think
    the problem might be.

'hope this helps....




keep the rudder amid ship and beware the odd typo

RE: Hi, I am getting error of Pr

(OP)
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("sched_appl_list_form");
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, [ ["", "", 0] ], [ [ "All", "  All  "] ]);

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

$patch_display_data->{'testcenter_list'} =
    ::prepare_options([ "All", @$testcenter_code ],
              [ "All", @$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'} = "<SELECT NAME=module>";
$patch_display_data->{'module'} .=
    ::prepare_options([ "All" , @$module_code], [ "All" ,
    @$module_name], undef, undef, undef);

$patch_display_data->{'module'} .= "</SELECT>";
    
$patch_display_data->{'slot_list'} =
    ::prepare_options([ "All" ], [ "            All             " ], 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("sched_appl_list_form");
}
no strict;


                (RaviShanker)



RE: Hi, I am getting error of Pr

Ravi,

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

None of them seem to be in this package.

RE: Hi, I am getting error of Pr

(OP)
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)

RE: Hi, I am getting error of Pr

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):

use DBI;

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

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

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

my @row;

while(@row = $sh->fetchrow_array){
    print "@row\n";
}

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?

Mike
michael.j.lacey@ntlworld.com
Cargill's Corporate Web Site

RE: Hi, I am getting error of Pr

about the CGI stuff


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


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


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

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

# 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 "Can't prepare SQL statement\n$DBI->errstr\n";

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

my @row;

while(@row = $sh->fetchrow_array)
  {
  print "row returned is \@row<BR>\n";
  }
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.




keep the rudder amid ship and beware the odd typo

RE: Hi, I am getting error of Pr

(OP)
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 +"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)                   

RE: Hi, I am getting error of Pr

If on a UNIX box....

prompt> find ./ -name "*" -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....




keep the rudder amid ship and beware the odd typo

RE: Hi, I am getting error of Pr

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

 

RE: Hi, I am getting error of Pr

(OP)
Hi Guys,

I want the code in Perl,Html for: someone please tell me how to find "how many user has logged concurrently at any sites(e.g. www.yahoo.com) i.e loginname,password". 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

RE: Hi, I am getting error of Pr

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.




keep the rudder amid ship and beware the odd typo

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close