Hi monks,
while trying out different possibilities for Anonymous Monks question
Select data between a START and END pattern, i did
# cat mt
#!/usr/bin/perl -w
@test = (
"192.168.1.1 index.html index 5 seconds",
"192.168.1.1 links.html links, index.html index 10 seconds ",
"192.168.1.1 article1.html art1, article2.html art2, adpage 200 s
+econds",
);
foreach (map { /[\d\.]+\s(.+)\sseconds/i } @test) { print "Test Data:
+$_\n" };
The result is what i have wanted.
# ./mt
Test Data: index.html index 5
Test Data: links.html links, index.html index 10
Test Data: article1.html art1, article2.html art2, adpage 200
As often as not i had the feeling perl "knows" what i want to do in this case too. That's a fact i like it so much for.
But actually i don't know why it does so because i expected to evaluate $1.