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