
meloyelo
User
Jun 13, 2008, 11:30 PM
Views: 3103
|
Re: [phamou] Special Extraction requirement...
|
|
|
Slurp the entire file into a variable. Then you can write a regular expression that spans more than one line:
my $log = ... # contents of the SQL log file while ($log =~ m/\{(.*?)\}\s*\{(.*)\}/sg) { print "execution time: $1\n"; print "sql statement: $2\n"; } Note the /s on the regular expression.
(This post was edited by meloyelo on Jun 13, 2008, 11:31 PM)
|