Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
ok people, I was able to get what I needed using OO CGI. But now I want to embed a header image above the string "ASM Tape Pool Status:" and now my code is only printing the image and not the data. Any ideas? thank you, derek
#!/usr/bin/perl use strict; use warnings; use CGI; #use GD; $ENV{"PATH"} = qq(/opt/SUNWsamfs/sbin:/usr/bin); #sub image #{ my $imgtype = qw(gif); my $imgpath = qq(/var/apache/htdocs/images/logo.gif); # open (IMAGE, $imgpath) or die $!; # print "Pragma: no-cache\n"; # print "Content-type: image/$imgtype\n\n"; # # while (read(IMAGE, my $buffer, 16_384) ) # { # print $buffer; # } # # close (IMAGE); #} my $q1 =new CGI; print $q1->header( -type => "image/gif"); while (read(IMAGE, my $buffer, 16_384) ) { print $buffer; my $q =new CGI; print $q->header, $q->start_html('OHIS ASM server: stkv440'), + # Header $q->h1({-style=>'Color:blue'},'ASM Tape Pool Status:'), + # Body open (ARC, "archiver -lv |") or die $!; my $flag=0; while (<ARC>) { if (/(?i)allsets/) { $flag=1; } if ($flag==1) { if (/(?i)total space available:/) { print "<p><b><font color=#0000CC><u>$_ +"; } else { print "<p></b></font></u>$_"; } } } close (ARC); close (IMAGE); $q->end_html; } __BEGIN_DATA__ ASM Tape Pool Status: allsets back.1 media: sf Volumes: STK000 Total space available: 58.8G back.2 media: sf Volumes: STK005 Total space available: 58.8G clinical1.1

In reply to Re^2: using CGI to output a system command by drock
in thread using CGI to output a system command by drock

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (10)
As of 2024-04-23 08:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found