+ #$$ref = $cgi->header( @FS::CGI::header ) . $$ref;
+ #$$ref = $cgi->header() . $$ref;
+ if ( dbh->can('sprintProfile') ) {
+ if ( lc($Response->{ContentType}) eq 'text/html' ) {
+ $$ref =~ s/<\/BODY>[\s\n]*<\/HTML>[\s\n]*$//i
+ or warn "can't remove";
+
+ #$$ref .= '<PRE>'. ("\n"x96). encode_entities(dbh->sprintProfile()). '</PRE>';
+ # wtf? konqueror...
+ $$ref .= '<PRE>'. ("\n"x4096). encode_entities(dbh->sprintProfile()).
+ "\n\n". &sprintAutoProfile(). '</PRE>';
+
+ $$ref .= '</BODY></HTML>';
+ }
+ dbh->{'private_profile'} = {};
+ }
+}
+
+#if ( defined(@DBIx::Profile::ISA) && DBIx::Profile::db->can('sprintProfile') ) {
+#if ( defined(@DBIx::Profile::ISA) && UNIVERSAL::can('DBIx::Profile::db', 'sprintProfile') ) {
+if ( defined(@DBIx::Profile::ISA) ) {
+
+ #warn "enabling profiling redirects";
+ *CGI::redirect = sub {
+ my( $self, $location) = @_;
+ my $page =
+ $cgi->header.
+ qq!<HTML><BODY>Redirect to <A HREF="$location">$location</A><BR><BR>!.
+ '<PRE>'. encode_entities(dbh->sprintProfile()).
+ "\n\n". &sprintAutoProfile(). '</PRE>'.
+ '</BODY></HTML>';
+ dbh->{'private_profile'} = {};
+ return $page;
+ };
+
+}
+
+sub by_total_time
+{
+ return $a->{total_time_in_sub} <=> $b->{total_time_in_sub};