Extracting some data from <% %>

Discussion in 'Perl Misc' started by sonet, Feb 9, 2006.

  1. sonet

    sonet Guest

    I can extraceing data from <% %>.But how can i know how many times i need to
    do?
    Or have good method to complete this job?

    #!/usr/bin/perl
    use strict;
    my $a=<<"HTML";
    <html>
    <body>
    <%
    template:datasrc=http://aaaa.com.tw/1.text

    %>
    12345
    <%
    template:datasrc=http://bbb.com.tw/2.text

    %>
    </body>
    </html>

    HTML
    my $i=0;
    while ($i++ < 2) {
    print $1 if $a=~/<%(.*?)%>/sg;
    }
     
    sonet, Feb 9, 2006
    #1
    1. Advertising

  2. sonet

    Guest

    Re: Extracting some data from <% %>

    sonet wrote:
    > I can extraceing data from <% %>.But how can i know how
    > many times i need to do?


    Hmmmmm. I wonder if that type of question has ever been asked before.
    In fact, I wonder if it is a "Frequently Asked Question."

    Maybe it is. Have you looked at:
    perldoc -q nesting
    "How do I find matching/nesting anything?"

    --
    http://DavidFilmer.com
     
    , Feb 9, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. walterd
    Replies:
    1
    Views:
    420
    DalePres
    Apr 28, 2004
  2. RSH
    Replies:
    1
    Views:
    435
    Eliyahu Goldin
    Jun 2, 2005
  3. =?Utf-8?B?Z2xlbm4=?=

    Extracting data from a DataSet

    =?Utf-8?B?Z2xlbm4=?=, Mar 21, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    1,532
    =?Utf-8?B?Z2xlbm4=?=
    Mar 21, 2006
  4. Max
    Replies:
    6
    Views:
    6,143
    Malcolm Dew-Jones
    Sep 17, 2004
  5. Albert Schlef

    Extracting some text from HTML

    Albert Schlef, Dec 27, 2009, in forum: Ruby
    Replies:
    2
    Views:
    106
    Dan Sr.
    Nov 2, 2010
Loading...

Share This Page