The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
SCCS - A slight scripting issue tangent UNIX for Dummies Questions & Answers 0 06-16-2008 08:50 AM
Perl scripting rsendhilmani Shell Programming and Scripting 3 07-05-2007 03:51 AM
Perl scripting rochitsharma UNIX for Advanced & Expert Users 2 08-24-2006 08:55 AM
Awk scripting issue hcclnoodles Shell Programming and Scripting 3 01-18-2005 09:23 AM
scripting issue moe2266 Shell Programming and Scripting 2 01-05-2005 10:32 AM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 12-10-2008
manik112 manik112 is offline
Registered User
  
 

Join Date: Dec 2008
Posts: 14
Need Help with Perl Scripting Issue.

The Perl script runs fine without any error from command line. The script executes an external command and prints the output on a web page. But somehow when I call it from URL it does not work. Any help will be appreciated. Here is the script:
--test.pl

#!/usr/bin/perl
#
use warnings;
use strict;
use Socket;

print "Content-type: text/html\n\n";

print <<ENDOFHTML;
<HTML>
<HEAD>
<TITLE>Test Page</B></CENTER></TITLE>
<BODY background="/icons/page-background.png">
<body text="#808080">
<IMG SRC="/icons/test.gif" width="142" height="60" align="left">
<h1 align="center" font size=1> Netops-DashBoard</center></h1>
<br>
<br>
ENDOFHTML

open(SMP, "/usr/local/bin/sshpass -p test ssh test.com /usr/contrib/bin/serverinfor -b |") || die "Failed: $!\n";

while ( <SMP> ) {
chomp;
my $line = $_;
print "$_ \n";
print "<br>\n";
} # while

print "</BODY>";
print "</HEAD>";
print "</HTML>";



-----The script does not work when we call from : http://www.xxx.xxx/test.pl

In the sense that the While Loop does not get executed.....
 

Bookmarks

Tags
shell script, shell scripting, unix scripting, unix scripting basics

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 08:48 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0