我对这个函数的用法不是很理解,我现在的初步认识是
这个函数的作用就是
1)将某个变量与某个class关联
In modern versions of Perl, you can bind any ordinary variable (scalar, array, or hash) to an
implementation class by using tie. (The class may or may not implement a DBM file.) You can break this
association with untie.
通过关联之后使用该变量则是通过方法调用实现的,但是在这样做有什么好处呢?
2)把某个变量的值或者文件的内容通过tie保存在一个格式文件中,以便达到共享信息的效果,类似一个数据库。
tie %userdb, "DB_File",$userdb,O_RDONLY,666,$DB_BTREE
or die "Unable to open $userdb database for reading

!\n";
unless (exists $userdb{$user}){
print "No logins from that user.\n";
untie %userdb;
untie %connectdb;
exit;
}
We've loaded the modules we need, taken our input, set a few variables, and tied them to our database files
但是我不理解的是这个代码是什么意思? 他把%userdb的值保存在$userdb文件中么?