#!/usr/bin/perlml -Tw
use strict;
use CGI;
use CGI::Carp qw(fatalsToBrowser); # show errors in browser
use Authen::Passphrase::BlowfishCrypt;
use Bytes::Random::Secure;
print "Content-type:text/html\n\n";
# read the CGI params
my $cgi = CGI->new;
my $username = $cgi->param("username");
my $password = $cgi->param("password");
if ($username =~ /[^a-zA-Z0-9]/) { die "Illegal characters" };
if ($password =~ /[^a-zA-Z0-9]/) { die "Illegal characters" };
my $settings = './settings.cnf';
use DBI;
my $dsn =
"DBI:mysql:DB;" .
"mysql_read_default_file=$dbsettings";
my $dbh = DBI->connect($dsn, undef, undef,{RaiseError=>1})
or die "Could not connect to database: …Run Code Online (Sandbox Code Playgroud) 所以,我想使用 Mariadb。有这个连接器-C。 https://downloads.mariadb.org/connector-c/
我该如何安装?坦率地说,它的文档很糟糕。甚至 3.0.5 的 src 文件也链接到 3.0.4 页面。
我没有找到安装二进制文件的方法,从 src 构建的文档很模糊。我更想知道如何安装两种方式(二进制和从源代码构建)
我正在使用 CentOS7 64 位。
如何组合两个字符串并将结果视为变量的名称?
我试过这个:
my $container0 = "voila";
my $container1 = "ssss";
my $container2 = "swat";
my $container3 = int rand 2;
my $ans = '$container'."$container3";
print "$ans";
Run Code Online (Sandbox Code Playgroud)
但它打印:
$container2
Run Code Online (Sandbox Code Playgroud)
我要打印:
swat
Run Code Online (Sandbox Code Playgroud)
(变量的值$container2).我怎样才能做到这一点?