这是我的情况.从前一个问题我得到了从grep方法获得价值的答案.
while(<READFILE>)
{
my ($dbtest_name) = grep(/@/,@dataRecord);
// Next I insert this value into a mysql database I get the following error message.
$sth->execute($dbtest_name);
}
DBD::mysql::st execute failed: Column 'test' cannot be null
Use of uninitialized value $dbtest_name in print
Run Code Online (Sandbox Code Playgroud)
问题,如何确保来自$ dbtest_name变量的值始终具有值而不是null?