How has support for placeholders and SQL injection prevention changed across recent Perl versions?

Recent versions of Perl have improved support for placeholders in SQL statements, which significantly enhances SQL injection prevention techniques. These advancements have made it easier for developers to write secure database interactions without resorting to manual sanitization methods.
Perl, SQL injection prevention, placeholders, database security, programming best practices
# Example of using placeholders with DBI in Perl
use DBI;

my $dbh = DBI->connect("DBI:mysql:database=test;host=localhost", "user", "password", {
    RaiseError => 1,
    PrintError => 0,
});

my $username = 'example_user';
my $sth = $dbh->prepare("SELECT * FROM users WHERE username = ?");
$sth->execute($username);

while (my @row = $sth->fetchrow_array()) {
    print "User: $row[0]\n";
}

$sth->finish();
$dbh->disconnect();

Perl SQL injection prevention placeholders database security programming best practices