Don't ask me to explain what the code does.

What is it supposed to do?

What makes a bad question? Before You Post ... How (Not) To Ask A Question How to ask questions the smart way

It's a bad idea to try to parse HTML using regular expressions (especially like that). There are some pure perl html parsers available if you're really in a bind, like YAPE::HTML by japhy, a real perl regex hacker.

Anyway, my own HTML::LinkExtractor seems perfect for what you're trying to do, which I'm guessing is something like:

#!perl #!/usr/bin/perl use CGI qw[:standard]; use HTML::LinkExtractor; use strict; use warnings; print header,start_html; { my $count=0; my $lE = HTML::LinkExtractor->new( sub { my( $lE, $t ) = @_; if( $t->{tag} eq 'a' ) { my ( $outer, $inner ) = $t->{_TEXT} =~ /(\d+)\((\d+)\) +/; return unless $outer and $inner; print a( { -href => $t->{href} }, $count++ ), qq{ [ $outer ][ $inner ]}, br; } } ); $lE->strip(1); $lE->parse(\q[ <a href = "http://polisource.com">12(2345678901234)</a> ]); } print end_html;


MJD says you can't just make shit up and expect the computer to know what you mean, retardo!
** The Third rule of perl club is a statement of fact: pod is sexy.


In reply to Re: Strange problems with CGI script by PodMaster
in thread Strange problems with CGI script by Wassercrats

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, details, 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, summary, 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.