Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

comment on

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

imagine that I have a document named finalgrades.html located at and it contains the following text:

<html> <head> <title></title> </head> <body> <b>Guy 1</b>, grade: 100<br> <b>Guy 2</b>, grade: 70<br> <b>Guy 3</b>, grade: 98<br> </body> </html>

I want a perl script ( to make a CGI ) which takes the values after "grade:" and before "<b>" for the line containing a name that I coose (for example "Guy 1"), and prints it to the screen when running it as a CGI on my webpage, something like this:

<html> <head> <title>CONGRATULATIONS TO THE PARTICIPANT Guy 1</title> </head> <body> <h1>Guy 1</h1> Has just got a "100" as a grade for this Seminar. Congratulations!!!<br> </body> </html>

edited: Sun Aug 3 15:19:23 2003 by jeffa - formatting, linkafied link edited: Mon Mar 13 10:25:23 2006 by jamiel - formatting, spelling, etc...

In reply to How do I extract text from an HTML page? by jamiel

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?

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (3)
As of 2023-03-25 14:53 GMT
Find Nodes?
    Voting Booth?
    Which type of climate do you prefer to live in?

    Results (63 votes). Check out past polls.