What's the while inside while code you tried? (we can advise if it's minor to fix or a compare it to other solutions.)
As for other solutions, the first question i think is if you can slurp in the whole log file or not. Assuming you can't due to size, you were on the right track with a while loop... perhaps something like:
while(my $s1 = <LOG>){
next unless $s1 =~ m#^(\d+/\d+/\d+) (\d+:\d+:\d+) user=(\S+) func\(#
+;
my ($date, $time, $user) = ($1, $2, $3);
... # above variables are available
while(my $s2 = <LOG>){
last if $s2 =~ /^\) #end trans#/;
... # $s2 is log data
}
}
Note you could do this w/a single while loop (as opposed to nested ones) if you used a boolean or two to keep track of being inside a log data section or not..
Update: I like the above solution of
$/ = '#end trans#' -- my original thought was to split() on the start line, but that would required the whole log in memory, so i switched back to the while/while method.. hopefully it will at least serve as a guide is debugging your while loop attempt.