473,385 Members | 2,028 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,385 software developers and data experts.

How to display PERL coding "Results" on webpages?

135 100+
How to display PERL coding "Results" on webpages? What I'm trying to do is to display the result of the following PERL code on to a webpage and its not working. What can I do?

Expand|Select|Wrap|Line Numbers
  1. #!c:/Perl/bin/perl.exe
  2.  
  3. use Net::Ping;
  4. use strict;
  5. use warnings;
  6.  
  7. my $host="192.168.0.1"; # Real IP removed by MODERATOR
  8.  
  9. my $p = Net::Ping->new("tcp", 5);
  10. my $result = $p->ping($host) ? "On-line.\n" : "Off-line.\n";
  11. $p->close();
  12.  
  13.  
  14. print <<EOF;
  15.  
  16. <html>
  17. <body>
  18. <h2> The Dedicated 2 SERVER $host is $result</h2>
  19. </body>
  20. </html>
  21.  
  22. EOF
  23.  
  24. __END__
  25.  
Jun 12 '07 #1
1 1609
KevinADC
4,059 Expert 2GB
print an http header before any other printing:

print "Content-type: text/html\n\n";
Jun 12 '07 #2

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

Similar topics

4
by: dmiller23462 | last post by:
Somebody take a look and give me any suggestions? My brain is nuked... Here's my deal....I have online submission forms on my intranet at work here....I am appending to an Access DB with the...
2
by: dmiller23462 | last post by:
Hey guys, I'm back again....I've got the results displaying that I wanted but instead of having a "next" or "previous" link displayed I am getting the error msg below (I actually get the data that...
3
by: Dmitry Jouravlev | last post by:
Hi, I have a number of C++ solutions in Visual Studio .NET and when i compile them using "Whole Program Optimization", certain projects report a LNK1171 error saying that c2.dll could not be...
11
by: Bruce Lawrence | last post by:
Ok, I'm baffled... I'm making a query in access 97 between 2 tables. There is a field in both tables called "DWGNO". OPENORD has a record with a DWGNO of "00000012345" DIEDATA has a record...
0
by: hash4sp | last post by:
Hi ! Can anybody help me with the code using Vb.net to display my database records in pages like google. Eg. 10 records per page and so on.... thanks & regards, Hash
2
bugboy
by: bugboy | last post by:
Hi i'm a beginner at php and my simple web query page doesn't work.. i swear i had it working at one point but now i've come back to it it doesn't. • My form works • My DB connection works •...
6
by: Elvis123 | last post by:
I want to "merge" the results of two queries: select DATE,CUSTOMER_ID from DB1 select DATE,CUSTOMER_ID from DB2 Then I want to be able to count the number of customers for each date in the...
7
by: ankitoshniwal | last post by:
Hello, I have been having this problem for the whole day today, so even after i googled for the solution i was not able to get one, so i had to post to this forum. I had checked the solutions...
1
by: Jenniferdb2 | last post by:
Hello All, create table a (i int); create table b(i int); insert into a values(1); ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...

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.