Sponsored Content
Top Forums Shell Programming and Scripting How to use JavaScript in Perl Object Oriented Post 302603489 by clx on Thursday 1st of March 2012 06:25:24 AM
Old 03-01-2012
From the beginning, Just for everything, I refer to the cpan/perldoc documentation for CGI and fortunately I get everything I want.

Below is an example I am using in one of my CGI script.

Code:
my $cgi = new CGI;

my $cookie = $cgi->cookie(-expires=>'now');

print $cgi->header(-type => "text/html", -charset => 'ISO-8859-1',-cookie=>$cookie);
print $cgi->start_html(-title=>'my Title',
						-style=>{'-src' => "${DOC_ROOT}" . 'css/style.css'},
						-head=>$cgi->Link({-rel=>'shortcut icon',-href=>'favicon.ico'}),
						-script=>{-type=>'text/javascript', -src=>"${DOC_ROOT}" . 'js/toggle.js'}
					);

## body goes here


print $cgi->end_html();


Please visit cpan for CGI documentation. You will get everything there.
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

A screen oriented command!!

Does a screen-oriented commands require you to specify an exact location or address for a particular operation ? Y or N cuz im having a debate right now in the office. (1 Reply)
Discussion started by: kprescod4158
1 Replies

2. UNIX for Dummies Questions & Answers

transforming small javascript into perl

I need to transform this small javascript into a perl. So then when I need to use it I can call $something, instead of using this javascript. Could someone help me archive this? (9 Replies)
Discussion started by: marringi
9 Replies

3. UNIX for Dummies Questions & Answers

onChange + javascript in perl CGI - question

Hello all, Am trying to include a onChange java script to my perl CGI application which uses POST method to upload files to file_server This is how I embedded javascript in the perl code that renders CGI application print qq| <script type="text/javascript" src="display.js"> </script>... (4 Replies)
Discussion started by: matrixmadhan
4 Replies

4. Shell Programming and Scripting

Perl + object-oriented programming help

Currently Im trying to write a program that manipulates a class-based object as part of its functionality. However, the perl compiler is complaining that the class's respective package is not returning a true value. I have done the following a) Created a new package containing the body of the... (1 Reply)
Discussion started by: JamesGoh
1 Replies

5. Programming

Open source my OIOIC, a completely new object-oriented mechanism for the C.

OIOIC is a completely new object-oriented mechanism for the C programming language. Please download the "OIOIC-Primer-2nd-Edition-English.tar.gz". (the English version of << OIOIC Primer >> ) http://code.google.com/p/oioic/downloads/list Welcome your advice! Using OIOIC, you can describe... (7 Replies)
Discussion started by: pervise.zhao
7 Replies

6. UNIX for Dummies Questions & Answers

Object reference not set to an instance of an object

I am new to PHP and UNIX. I am using Apache to do my testing on a Windows Vista machine. I am getting this error when I am trying to connect to a web service. I did a search and did not see any posts that pertain to this. Here is my function: <?php function TRECSend($a, $b, $c, $d,... (0 Replies)
Discussion started by: EddiRae
0 Replies

7. Shell Programming and Scripting

perl - return an object from subroutine - Net::LDAP

Hi all, I'm not even sure a person can do this in perl, seems like you should be able to though. Here's the error IO::Socket::INET: connect: Operation now in progress at server_search.pl line 256, <DATA> line 466. Here's the perl code... sub ldap_new{ $nl = Net::LDAP->new( "$_" ) or... (3 Replies)
Discussion started by: jtollefson
3 Replies

8. Shell Programming and Scripting

How to call perl web service from javascript?

Hi, I would like to call the below perl web service from javascript .Any help would be appreciated.I am new to web services.Please do the needful. Server Program(Perl Web Service) #!/usr/bin/perl use lib '/usr/lib/perl5/5.8.8/SOAP-Lite-0.65_3/lib'; use SOAP::Transport::HTTP; use Demo;... (3 Replies)
Discussion started by: liyakathali
3 Replies

9. Programming

How to initialize an object with another object of different class?

How to initialize an object of class say "A", with an object of type say "B". The following code give the error message "error: conversion from âAâ to non-scalar type âBâ requested" #include <iostream> using namespace std; class B; class A{ public: A() { cout <<"\nA()" << endl; } ... (1 Reply)
Discussion started by: techmonk
1 Replies
HOBBIT-NKVIEW.CGI(1)					      General Commands Manual					      HOBBIT-NKVIEW.CGI(1)

NAME
hobbit-nkview.cgi - Xymon Critical Systems view CGI SYNOPSIS
hobbit-nkview.cgi DESCRIPTION
hobbit-nkview.cgi is invoked as a CGI script via the hobbit-nkview.sh CGI wrapper. hobbit-nkview.cgi matches the current critical statuses against the hobbit-nkview.cfg(5) file, and generates the "Critical Systems" view. RELATION TO BBNK PAGE
This view is a replacement for the statically generated "bbnk" page provided in versions of Xymon prior to version 4.2. Although the "bbnk" pages are supported throughout Xymon 4.x, it is recommended that You switch to the newer Critical Systems view provided by this CGI. OPTIONS
--nkacklevel=NUMBER Sets the acknowledgment level for acknowledgments sent via the hobbit-ackinfo.cgi(1) page. Note that this may be overridden by the configuration of the hobbit-ackinfo.cgi utility. --env=FILENAME Loads the environment defined in FILENAME before executing the CGI script. --area=NAME Load environment variables for a specific area. NB: if used, this option must appear before any --env=FILENAME option. --debug Enables debugging output. ENVIRONMENT VARIABLES
BBHOME Used to locate the template files for the generated web pages. QUERY_STRING Contains the parameters for the CGI script. SEE ALSO
hobbit-ackinfo.cgi(1), xymon(7) Xymon Version 4.2.3: 4 Feb 2009 HOBBIT-NKVIEW.CGI(1)
All times are GMT -4. The time now is 05:46 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy