tos has asked for the wisdom of the Perl Monks concerning the following question:
The result is what i have wanted.# 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" };
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.# ./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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: maps implicit "$1-handling"
by diotalevi (Canon) on May 02, 2003 at 20:37 UTC | |
|
Re: maps implicit "$1-handling"
by dragonchild (Archbishop) on May 06, 2003 at 13:50 UTC |