Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
Ok. I'm feeling a bit on the silly side asking this, but for the life of me, I can't figure this out. I'm trying to run an existing program from a web interface and simply return the output to a browser. Here's the code (read: mess):
#!/usr/local/bin/perl -w use strict; use CGI; use CGI::Carp qw(fatalsToBrowser); use diagnostics; my $query = new CGI; print $query->header, $query->start_html ( -title => "Tape Pull Process Tool" -bgcol +or => "ffffff" ), $query->h1 ("Process Tape Pulls" ), $query->hr; &print_prompt($query); &vmquery($query); &makeEnd($query); sub print_prompt { my ($query) = @_; my $cmd = "/opt/openv/volmgr/bin/vmquery -m $mediaID"; print $query->start_form; print $query->p("Beginning: Date & Time"), $query->textfield ( -name=>"from", -size=>22, -maxlength=>19 ); print $query->p("End: Date & Time"), $query->textfield ( -name =>"to", -size =>22, -maxlength=>19 ); print $query->p("Tape ID"), $query->textfield ( -name=>"mediaID", -action = "$cmd", -size =>25, -maxsize =>25 ); print " \"; print "<p>", $query->reset; print $query->submit('action','submit'); print $query->end_form; print <hr>; } sub makeEnd { my ($query) = @_; print $query->end_html; }

In reply to run command from CGI program and display output by blink

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

  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

    What's my password?
    Create A New User
    and all is quiet...

    How do I use this? | Other CB clients
    Other Users?
    Others browsing the Monastery: (8)
    As of 2018-03-19 19:34 GMT
    Find Nodes?
      Voting Booth?
      When I think of a mole I think of:

      Results (246 votes). Check out past polls.