DBI::st appears to re-use internally an arrayref (I just got bitten by this today). You will have to store the record yourself:
my $first = undef;
while (my $record = $sth->fetchrow_arrayref) {
unless (defined $first) { @{$first} = @{$record} }
# other stuff
}
..although I'm unclear as to why you can't just stop retrieving records after the first, or why you can't just use a 'limit 1' clause in your SQL.
Also my DBI doesn't define a fetch method on statement handles, only fetchrow_* and fetchall_*, so you may need to re-jig my example.
Update: jZed++ for pointing out fetch is an alias for fetchrow_arrayref. Thanks, I've managed to miss that in every reading of perldoc DBI.