# create a DBI::Profile object. Notice that the object # is an attribute of $sth, not a standalone entity. # no "my" is required $sth->{Profile} = DBI::Profile->new; # Set the profile level $sth->{Profile} = 4; # do something with $sth # .... # # print the output using a built-in method print $sth->{Profile}->format; # reset the internal data, so new profiling info # can be stored $sth->{Profile}->{Data} = undef; # do something else with $sth # .... # # print the profile results again print $sth->{Profile}->format; # finally, disable the profile status, so it does nothing # at DESTROY time $sth->{Profile} =0; }