Sponsored Content
Top Forums Shell Programming and Scripting Displaying text file in browser - perl Post 302267170 by Dabheeruz on Thursday 11th of December 2008 06:35:32 PM
Old 12-11-2008
Displaying text file in browser - perl

Don't know why this didn't get posted before but...

I am having issues displaying a log file in the browser using perl and I can't get it to display at all, All i get is WHITE (blank page). I have proper permissions in my cgi-bin directory and everywhere else. So I know that's NOT the issue. Also when I try to manually run the script from console , it spits out the contents of the file just fine.

Here is snippet of my code:

Code:
#!/usr/bin/perl

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

open (FH , "access.log") || die "Blah $!";

while (<FH>) {
        print $_ ;
}
close (FH);

Here is the contents of the log file..its just access.log file.

Code:
1219582729.698    133 24.130.155.89 TCP_MISS/200 1496 POST http://ocsp.thawte.com/ gsingh DIRECT/199.7.54.72 application/ocsp-resp
onse
1219582730.138     53 24.130.155.89 TCP_MISS/200 1496 POST http://ocsp.thawte.com/ gsingh DIRECT/199.7.54.72 application/ocsp-resp
onse
1219582730.512     81 24.130.155.89 TCP_MISS/200 1891 POST http://ocsp.thawte.com/ gsingh DIRECT/199.7.54.72 application/ocsp-resp
onse
1219582791.993  59571 24.130.155.89 TCP_MISS/200 1712 CONNECT mail.google.com:443 gsingh DIRECT/74.125.19.19 -
1219582793.002  60565 24.130.155.89 TCP_MISS/200 1704 CONNECT www.google.com:443 gsingh DIRECT/74.125.19.103 -
1219582793.043  60608 24.130.155.89 TCP_MISS/200 4695 CONNECT mail.google.com:443 gsingh DIRECT/74.125.19.17 -
1219582793.135  60725 24.130.155.89 TCP_MISS/200 2976 CONNECT mail.google.com:443 gsingh DIRECT/74.125.19.17 -
1219582793.180  63199 24.130.155.89 TCP_MISS/200 17672 CONNECT mail.google.com:443 gsingh DIRECT/74.125.19.18 -
1219582793.217  60788 24.130.155.89 TCP_MISS/200 4252 CONNECT mail.google.com:443 gsingh DIRECT/74.125.19.83 -
1219582793.228  60399 24.130.155.89 TCP_MISS/200 1899 CONNECT mail.google.com:443 gsingh DIRECT/74.125.19.19 -
1219582793.333  60480 24.130.155.89 TCP_MISS/200 1762 CONNECT mail.google.com:443 gsingh DIRECT/74.125.19.83 -

Any help is highly appreciated Smilie

Thanks
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Text-based internet browser?

Dear all, I can only use text-based terminal, x-window is not support my session. Do anyone know have any text-based Internet browser in Sparc sun? Regards Wilson (2 Replies)
Discussion started by: wilsonchan1000
2 Replies

2. UNIX for Advanced & Expert Users

script to open the specified url in a browser from a text file

Hi All, here i am struc (6 Replies)
Discussion started by: gsp
6 Replies

3. Shell Programming and Scripting

Displaying text file in browser - perl

I am having issue dispalying text file in browser using perl. Here is my code: #!/usr/bin/perl print "content-type: text/html \n\n"; open (FH , "access.log") || die "Blah $!"; while (<FH>) { print $_ ; } I have correct permissions and everything. The weired thing is when I... (1 Reply)
Discussion started by: Dabheeruz
1 Replies

4. UNIX for Dummies Questions & Answers

Displaying Text

Hi guys! I am very much new to UNIX...and I was just wondering on how you would display this text format in UNIX with only just one command : Text 1 Text 2 Text 3 Texts are in aligned vertically in such format...Thanks for your help :) (8 Replies)
Discussion started by: Knowledge_Xfer
8 Replies

5. UNIX for Dummies Questions & Answers

How can I append a text at end of file after displaying the file

I have a file "sample.txt" with the content as below: Hi This is a Sample Text. I need a single command using cat which serve the following purpose. 1.display the contents of sample.txt 2.append some text to it 3. and then exit But, all should be served by a sinle command.:confused: (1 Reply)
Discussion started by: g.ashok
1 Replies

6. Shell Programming and Scripting

Displaying Result to a Text File

Hi; I am scripting in Shell and i want to write output (on screen) to a text file? ... | tee gcsw/output.txt doesnot work? :(:( (6 Replies)
Discussion started by: gc_sw
6 Replies

7. Web Development

Too long in displaying the data in a Web Browser

this is my another one question as well as my sample program. Because of the big data the gets from the database.,it takes time to display the output in a web browser.,is there any way to display the output as faster as it can..?my time is wasting because of too long to display.:confused: ... (3 Replies)
Discussion started by: Jeneca
3 Replies

8. Shell Programming and Scripting

Displaying a number in binary using perl

printf FH2" 3'b%b : begin\n",$i; where i is an integer in the loop is displaying 3'b1 : begin expected output was 3'b001 : begin (1 Reply)
Discussion started by: dll_fpga
1 Replies

9. Shell Programming and Scripting

Displaying certain text in a msg.

I have a requirement to display a part of an html response that my application gets. The response looks like this: <html><a href='com.aprisma.spectrum.app.sd.client.SDHyperlinkHandler' sdTicketHandle='cr:419900' ocAlarmId='506618ea-f013-102d-02a7-0050569d7aa8'... (3 Replies)
Discussion started by: dlundwall
3 Replies

10. Shell Programming and Scripting

Help with text modification and displaying

I have a file storing some text and another file storing some numbers I want to display characters other than the specified place of strings one.txt xyz abc 233 skfo 4r443 sfs abc abcd sd fsdf sdfd abc 11 abc 33 abc dsaf two.txt Nt_djd_k='5-6,7-9' Nt_hh_l='3-6,7-8' a=`grep... (4 Replies)
Discussion started by: rahulsk
4 Replies
zlarft.f(3)							      LAPACK							       zlarft.f(3)

NAME
zlarft.f - SYNOPSIS
Functions/Subroutines subroutine zlarft (DIRECT, STOREV, N, K, V, LDV, TAU, T, LDT) ZLARFT Function/Subroutine Documentation subroutine zlarft (characterDIRECT, characterSTOREV, integerN, integerK, complex*16, dimension( ldv, * )V, integerLDV, complex*16, dimension( * )TAU, complex*16, dimension( ldt, * )T, integerLDT) ZLARFT Purpose: ZLARFT forms the triangular factor T of a complex block reflector H of order n, which is defined as a product of k elementary reflectors. If DIRECT = 'F', H = H(1) H(2) . . . H(k) and T is upper triangular; If DIRECT = 'B', H = H(k) . . . H(2) H(1) and T is lower triangular. If STOREV = 'C', the vector which defines the elementary reflector H(i) is stored in the i-th column of the array V, and H = I - V * T * V**H If STOREV = 'R', the vector which defines the elementary reflector H(i) is stored in the i-th row of the array V, and H = I - V**H * T * V Parameters: DIRECT DIRECT is CHARACTER*1 Specifies the order in which the elementary reflectors are multiplied to form the block reflector: = 'F': H = H(1) H(2) . . . H(k) (Forward) = 'B': H = H(k) . . . H(2) H(1) (Backward) STOREV STOREV is CHARACTER*1 Specifies how the vectors which define the elementary reflectors are stored (see also Further Details): = 'C': columnwise = 'R': rowwise N N is INTEGER The order of the block reflector H. N >= 0. K K is INTEGER The order of the triangular factor T (= the number of elementary reflectors). K >= 1. V V is COMPLEX*16 array, dimension (LDV,K) if STOREV = 'C' (LDV,N) if STOREV = 'R' The matrix V. See further details. LDV LDV is INTEGER The leading dimension of the array V. If STOREV = 'C', LDV >= max(1,N); if STOREV = 'R', LDV >= K. TAU TAU is COMPLEX*16 array, dimension (K) TAU(i) must contain the scalar factor of the elementary reflector H(i). T T is COMPLEX*16 array, dimension (LDT,K) The k by k triangular factor T of the block reflector. If DIRECT = 'F', T is upper triangular; if DIRECT = 'B', T is lower triangular. The rest of the array is not used. LDT LDT is INTEGER The leading dimension of the array T. LDT >= K. Author: Univ. of Tennessee Univ. of California Berkeley Univ. of Colorado Denver NAG Ltd. Date: April 2012 Further Details: The shape of the matrix V and the storage of the vectors which define the H(i) is best illustrated by the following example with n = 5 and k = 3. The elements equal to 1 are not stored. DIRECT = 'F' and STOREV = 'C': DIRECT = 'F' and STOREV = 'R': V = ( 1 ) V = ( 1 v1 v1 v1 v1 ) ( v1 1 ) ( 1 v2 v2 v2 ) ( v1 v2 1 ) ( 1 v3 v3 ) ( v1 v2 v3 ) ( v1 v2 v3 ) DIRECT = 'B' and STOREV = 'C': DIRECT = 'B' and STOREV = 'R': V = ( v1 v2 v3 ) V = ( v1 v1 1 ) ( v1 v2 v3 ) ( v2 v2 v2 1 ) ( 1 v2 v3 ) ( v3 v3 v3 v3 1 ) ( 1 v3 ) ( 1 ) Definition at line 164 of file zlarft.f. Author Generated automatically by Doxygen for LAPACK from the source code. Version 3.4.1 Sun May 26 2013 zlarft.f(3)
All times are GMT -4. The time now is 09:23 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy