Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Extracting some data from <% %>

Reply
Thread Tools

Extracting some data from <% %>

 
 
sonet
Guest
Posts: n/a
 
      02-09-2006

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;
}



 
Reply With Quote
 
 
 
 
usenet@DavidFilmer.com
Guest
Posts: n/a
 
      02-09-2006
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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Extracting some text from HTML Albert Schlef Ruby 2 11-02-2010 09:35 AM
Extracting data from a DataSet =?Utf-8?B?Z2xlbm4=?= ASP .Net 0 03-21-2006 06:39 PM
Extracting Tables and columns with data types from a database RSH ASP .Net 1 06-02-2005 02:43 PM
Extracting text data from MS Word document Max Java 6 09-16-2004 11:01 PM
Extracting ASP.NET data in another Class walterd ASP .Net 1 04-28-2004 01:32 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57