Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Perl CGI output truncated
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  6 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
dippa  
View profile  
 More options Oct 28 2008, 12:28 am
From: dippa <gerard.sha...@gmail.com>
Date: Mon, 27 Oct 2008 21:28:06 -0700 (PDT)
Local: Tues, Oct 28 2008 12:28 am
Subject: Perl CGI output truncated
Hi,

Scratching my head with an issue where my Perl CGI output is being
truncated, however when running directly from the command line it
works. I've tried apache2 without any chance.

Below is a minimal version of a script I'm useing to pull info from a
Cisco router and display in the web browser:
---
#!/usr/bin/perl -w

use strict;
use CGI ':standard';

my $output;

print header;
print start_html('Test');
print h1('Testing...');

$output = `rsh <cisco_router> ping <ip_addr>`;
print "<pre>$output</pre>";

print end_html();

exit;
---

The problem being the output is being truncated:
---
Testing...

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to <ip_addr>, timeout is 2 seconds:
!
---

Missing:
---
!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/4/8 ms
---

I'm running:
# perl -v

This is perl, v5.8.8 built for i486-linux-gnu-thread-multi

Copyright 1987-2006, Larry Wall

Perl may be copied only under the terms of either the Artistic License
or the
GNU General Public License, which may be found in the Perl 5 source
kit.

Complete documentation for Perl, including FAQ lists, should be found
on
this system using "man perl" or "perldoc perl".  If you have access to
the
Internet, point your browser at http://www.perl.org/, the Perl Home
Page.

# apache -v
Server version: Apache/1.3.34 (Debian)
Server built:   Jan 18 2008 19:16:57
---

Any help would be appreciated.

Thanks


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Praveen P  
View profile  
 More options Oct 28 2008, 1:22 am
From: "Praveen P" <pravee...@gmail.com>
Date: Tue, 28 Oct 2008 10:52:26 +0530
Local: Tues, Oct 28 2008 1:22 am
Subject: Re: Perl CGI output truncated

can you replace "$output = `rsh <cisco_router> ping <ip_addr>`;"
with
"@output = `rsh <cisco_router> ping <ip_addr>`;" and try ..

--
#####################
#          Praveen~          #
#     +919895066033     #
#####################

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Praveen P  
View profile  
 More options Oct 28 2008, 1:24 am
From: "Praveen P" <pravee...@gmail.com>
Date: Tue, 28 Oct 2008 10:54:44 +0530
Local: Tues, Oct 28 2008 1:24 am
Subject: Re: Perl CGI output truncated

let me know whether that worked or not

--
#####################
#          Praveen~          #
#     +919895066033     #
#####################

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
dippa  
View profile  
 More options Oct 28 2008, 1:57 am
From: dippa <gerard.sha...@gmail.com>
Date: Mon, 27 Oct 2008 22:57:32 -0700 (PDT)
Local: Tues, Oct 28 2008 1:57 am
Subject: Re: Perl CGI output truncated
Thanks for the response Praveen,

bo luck with the suggested changes, have also tried with the same
result:
---
open(RSH,"rsh dslcore2.syd.pacific.net.au ping 203.12.144.90 |") ||
die "Failed: $!\n";
while ( <RSH> ) {
   print;

}

---

From the command line they do however work, just not when run through
Apache (tried apache2 as well)...

On Oct 28, 4:24 pm, "Praveen P" <pravee...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Sharad Pisal  
View profile  
 More options Nov 4 2008, 12:57 pm
From: "Sharad Pisal" <sharadpi...@gmail.com>
Date: Tue, 4 Nov 2008 23:27:15 +0530
Local: Tues, Nov 4 2008 12:57 pm
Subject: Re: Perl CGI output truncated

if its working fine from command line .. and not from web .. an smell some
env issues.. try running the script from command line  with user as with
apache works...

2008/10/28 dippa <gerard.sha...@gmail.com>

--
Regards
Sharad Pisal

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
dippa  
View profile  
 More options Dec 1 2008, 12:43 am
From: dippa <gerard.sha...@gmail.com>
Date: Sun, 30 Nov 2008 21:43:31 -0800 (PST)
Local: Mon, Dec 1 2008 12:43 am
Subject: Re: Perl CGI output truncated
Worked it out, using rsh with the –n switch (prevents is from pulling
the output from stdin).

It is strange the truncation is only occurring on the SB IOS releases
but this is a better way of running the command from within a script.

Thanks for the help.

On Nov 5, 4:57 am, "Sharad Pisal" <sharadpi...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google