473,396 Members | 1,940 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How do i Call Perl script from HTML

rajiv07
141 100+
Hi to All,

I have try to execute a perl script in html.But nothing get display

What i have tried so for is

The referrer.pl
---------------
Expand|Select|Wrap|Line Numbers
  1. #!/usr/bin/perl
  2. use CGI;
  3.  
  4. my $cReferrer=$ENV{'REFERER'};
  5.  
  6.  
  7. print "Content-type:text/html\n\n";
  8.  
  9. print "$cReferrer";
  10.  
Html File

[HTML]<HTML>
<HEAD>
<TITLE> CHECK </TITLE>
</HEAD>

<BODY>
<script language="JavaScript" type="text/javascript">
src="/cgi-bin/query/referrer.pl";
</script>
</BODY>
</HTML>
[/HTML]

Please Let Me know if anything that i have to change in the code.

Thanks

Regards
Rajiv
Dec 26 '07 #1
1 3085
KevinADC
4,059 Expert 2GB
Hi to All,

I have try to execute a perl script in html.But nothing get display

What i have tried so for is

The referrer.pl
---------------
Expand|Select|Wrap|Line Numbers
  1. #!/usr/bin/perl
  2. use CGI;
  3.  
  4. my $cReferrer=$ENV{'REFERER'};
  5.  
  6.  
  7. print "Content-type:text/html\n\n";
  8.  
  9. print "$cReferrer";
  10.  
Html File

[HTML]<HTML>
<HEAD>
<TITLE> CHECK </TITLE>
</HEAD>

<BODY>
<script language="JavaScript" type="text/javascript">
src="/cgi-bin/query/referrer.pl";
</script>
</BODY>
</HTML>
[/HTML]

Please Let Me know if anything that i have to change in the code.

Thanks

Regards
Rajiv
Try just running the script directly from the URL:


Expand|Select|Wrap|Line Numbers
  1. #!/usr/bin/perl
  2. use strict;
  3. use warnings;
  4. use CGI::Carp qw/fatalsToBroswer;
  5. print "Content-type:text/html\n\n$ENV{'REFERER'};"
  6.  
if that works then it should work as you have it in your html code. If it does not work it's either a permissions problem or you might need to upload the perl script in ASCII (text) mode, not binary mode.
Dec 26 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: sam | last post by:
I have a function writen in Perl that takes a name-value list (array) as argument and returns a name-value list (array). My question is: How to call this function from PHP and get the returned...
7
by: Danny | last post by:
Newbie here Thanks for the help with this command: print "Status: 204 No Content\n\n"; which returns nothing in a perl script. This is great because I just want my perl script to increment a...
7
by: Wladimir Borsov | last post by:
I want to call a perl script myscript.pl in my cgi-bin from a HTML web page. This call should NOT use SSI (because in this case HTTPS://.... protocol is necessary). Furthermore NO button click...
8
by: jonniethecodeprince | last post by:
Hello all. I need to get a html page to work with a PERL script <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"...
22
by: owlice | last post by:
Greetings! I thought I'd add a little something to a web site, a "tip of the week," and wanted it automated so that if I get hit by a truck (or, more likely, am forgetful), the tip is updated...
10
by: happyse27 | last post by:
Hi All, I got this apache errors(see section A1 and A2 below) when I used a html(see section b below) to activate acctman.pl(see section c below). Section D below is part of the configuration...
82
by: happyse27 | last post by:
Hi All, I modified the user registration script, but not sure how to make it check for each variable in terms of preventing junk registration and invalid characters? Two codes below : a)...
3
by: happyse27 | last post by:
Hi All, I am creating the perl script using html form(with embedded javascript inside). When using this html form with javascript alone, it works where the form validation will pop up...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.