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

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

Here is a mildly improved version. HTML::Perlinfo::Modules is something I wouldn't recommend though. In addition to outputting broken non-version specific HTML, it could be replaced with just a bit of custom of code. Mixing display and system info trawling feels dirty, but in a bad way.

use strict; use warnings; use CGI ":standard"; use HTML::Perlinfo::Modules; print header(), start_html(-title => "Perl Module Search", -head => style({type => 'text/css'}, join('',<DATA>) ), ), h1("Search your Perl modules"); print div({-style => "float:left; width: 20%;"}, h3("Search..."), start_form(-method => "get", -enctype => "application/x-www-form-urlencoded", -onsubmit => "return this._x ? false : ( this._x = +true )"), textfield("query"), br(), checkbox("regex"), submit(), end_form(), ); if ( my $query = param("query") ) { my $module = HTML::Perlinfo::Modules ->new ->print_modules( show_only => param("regex") ? qr/$query/i : qr/\Q$query\ +E/, full_page => 0 ); print div({-style => "float:left; width: 75%; margin-left: 2%"}, $module || h2("No modules found"), ); } print end_html(); __DATA__ body { font: 11px/13px helvetica-neue, helvetica, sans-serif; color: #001; } a:link {color: #000099; text-decoration: none;} a:hover {text-decoration: underline;} table {border-collapse: collapse; width: 100%;} .center {text-align: center;} .center table { margin-left: auto; margin-right: auto; text-align: lef +t;} .center th { text-align: center !important; } td, th { border: 1px solid #001; } .modules table {border: 0;} .modules td { border:0;} .modules th { border:0;} .p {text-align: left;} .e {background-color: #ccf; font-weight: bold; } .h {background-color: #99c; font-weight: bold; } .v {background-color: #ccc; } i {color: #666666; background-color: #ccc;}

In reply to Re: Perl module search engine by Your Mother
in thread Perl module search engine by jacques

Title:
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?
    Username:
    Password:

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

    How do I use this? | Other CB clients
    Other Users?
    Others cooling their heels in the Monastery: (4)
    As of 2019-12-15 23:05 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      No recent polls found

      Notices?