| 订阅 | 在线投稿
分享
 
 
当前位置: 王朝网络 >> perl >> gong neng feng fu de Perl: yong Perl bao cun

gong neng feng fu de Perl: yong Perl bao cun

2008-05-19 06:25:45 编辑來源:互联网 评论
 
 
 
本文为【功能丰富的Perl:用Perl保存】的拼音翻译版
  shu ju cun chu shi ji suan ji bian cheng zhong chang jian de wen ti 。CPAN Persistent lei tong guo yi ge jian hua shu ju chuang jian 、 jian suo he guan li de tong yong jie kou , shi shu ju cun chu bian de jian dan 。 tong guo mian xiang dui xiang de fang fa , ke yi zai xiang mu zhong jiang Persistent lei zuo wei zi ji de shu ju lei de fu lei tou ming di shi yong 。
  chi jiu xing jie shao
  suo you cheng xu yuan dou you bi xu jie jue shu ju chi jiu xing wen ti de jing li 。 li ru , dui yu ru jiang wen dang cun ru wen jian he jiang shi wu cun ru shu ju ku deng ren wu , ji shi zui jian dan de ying yong cheng xu ye xu yao da liang gong zuo 。 ke yi jiang shu ju chi jiu xing ding yi wei cheng xu he cun chu she bei zhi jian da cheng de qi yue , gai qi yue zhi ding ru he cun chu he jian suo shu ju 。
  CPAN ding yi :
  “CPAN shi zong he Perl dang an wang luo 。 zong he : qi mu de shi bao han ke neng xu yao de suo you Perl zi liao 。 dang an : cong 1999 nian 9 yue zhi jin , yi you 760 zhao zi jie 。 wang luo : quan shi jie you chao guo yi bai ge CPAN jing xiang zhan dian 。”
  ben wen ji zhong jiang shu zai zuo zhe he du zhe shi xian dou zhi dao dui xiang shu xing de qing kuang xia , ru he shi dui xiang shu xing chi jiu 。 ben wen bu tao lun dong tai fa xian dui xiang shu xing he cun chu shu xing yi wai de te xing ( ru xing wei ) de zhu ti , yin wei xu yao hen duo pian fu cai neng ba zhe xie zhu ti jiang qing chu 。
  shu xi mian xiang dui xiang bian cheng 、 shu ju ku 、Perl he Perl ji cheng jiang dui yue du ben wen you bang zhu 。
  shi dui xiang shu xing chi jiu zhi shi ruan jian kai fa guo cheng de yi xiao bu fen 。 shou xian , bi xu que ding chi jiu xing de xu qiu 。 xu yao bao cun shen me ? xu yao hui fu shen me ? zai hui fu cun chu de shu ju zhi qian , xu yao shou gong bian ji ma ? zhu ru ci lei de wen ti jiang que ding ruan jian ru he jiang chi jiu shu ju gui dang 。 bu xing di shi , mei you yi fen tiao cha biao ke yi que ding xiang mu que qie de chi jiu xing xu yao 。 ruan jian she ji shi bi xu tong guo zhi neng she ji , ding yi bing man zu xiang mu xu qiu 。 hen chong yao de yi dian shi , zui hou de jie jue fang an yao que shi shi wen ti de jie jue fang an , er bu zhi shi shi mao de xing ye ci yu 。 li ru ,XML jie jue shu ju chi jiu xing wen ti de neng li bi zhi yong zhuan tou lai jian zao fang wu hao bu dao na li 。
  chi jiu shu ju shi li
  Perl wen jian simple xian shi le yu ding yi de guan jian zi ji he ru he neng gou shi xian jian dan de chi jiu xing 。 zhe zhong fang fa you hen duo wen ti : wen jian ge shi shi ren yi de , zhi bao cun yi ge guan jian zi ji he , gen ben mei you dui xiang 、 shu ju zhi xian zhi dao yi xing wen ben deng deng 。
  Persistent lei de jian dan shi yong :Persistent::File
  Persistent lei zhi zai shi shu ju chi jiu xing bian de jian dan 。 wei ci , nin bi xu yue du wen dang 。 dui yu zhang wo chu li chi jiu shu ju de fang bian de yu zhi lei er yan , zhe zhi shi hen xiao de dai jia 。 suo yi , xian hua shang ji fen zhong huo ji xiao shi lai zuo zhe jian shi , yi hou jiang jie sheng nin de shi jian 。 you guan wen dang he shi li , qing shen yue Persistent lei zhu ye ( qing shen yue shen kao zi liao )。
  di yi ge shi li first jiang ji yu Persistent::File mo kuai wen dang zhong gei chu de simple shi li , bing jiang miao shu da dao chi jiu xing de bu zhou 。
  qing dan 1: ding yi shu ju
  my %problems = (
  'Homework 1, Problem 1' = [0,5,2],
  'Homework 1, Problem 2' = [1,8,5],
  'Homework 1, Problem 3' = [2,2,4],
  'Homework 1, Problem 4' = [3,0,3],
  'Homework 1, Problem 5' = [4,1,2],
  );
  shou xian , ding yi yao cun chu zai shu ju cun chu qi zhong de shu ju 。 zai Persistent lei zhong , shu ju cun chu qi shi chou xiang cun chu she bei , li ru , ta ke yi shi wen jian huo shu ju ku 。 gai li shi zi bao rong de , dan shi shu ju ye ke neng lai zi bie chu 。
  qing dan 2: shi yong eval lai bu huo cuo wu
  use English;
  eval
  {
  };
  print "An error occurred: $EVAL_ERROR\n" if $EVAL_ERROR;
  yin wei bu xi wang cheng xu zai chu xian zhi xing cuo wu shi zhong zhi , suo yi jiang suo you cao zuo fang zai eval yu ju zhong 。English mo kuai shi wo men ke yi shi yong $EVAL_ERROR 、 er bu shi $@ lai biao shi cuo wu xiao xi 。
  qing dan 3: ding yi shu ju cun chu qi
  # cong wen jian chuang jian chi jiu dui xiang
  my $equation = new Persistent::File('variables.txt');
  wo men zai zhe li chuang jian le xin de Persistent::File dui xiang , qi nei rong jiang cun chu zai wen jian variables.txt zhong 。
  qing dan 4: ding yi shu xing
  $equation-add_attribute('name', 'ID', 'VarChar', undef, 80);
  $equation-add_attribute('x', 'Persistent', 'Number', 0, 10);
  $equation-add_attribute('y', 'Persistent', 'Number', 0, 10);
  $equation-add_attribute('z', 'Persistent', 'Number', 0, 10);
  $equation-add_attribute('answer', 'Transient', 'Number', undef, 10);
  wo men chuang jian le wu ge shu xing : yi ge wei yi biao shi 、 san ge chi jiu shu ju cheng yuan he yi ge fei chi jiu ( zan shi ) shu ju cheng yuan 。Persistent lei jiang zi dong chuang jian bi yao de han shu ( li ru ,$equation-answer()) lai fang wen shu ju cheng yuan 。
  qing dan 5: qing chu shu ju cun chu qi
  $equation-restore_all();
  $equation-delete while $equation-restore_next();
  restore_all fang fa jian suo zheng ge shu ju cun chu qi de nei rong 。restore_where he restore fang fa fen bie yong lai xuan ze fu he mou xie biao zhun de dui xiang he dan yi dui xiang 。delete fang fa chu qu dang qian deng shi ,restore_next fang fa yi zhi xia yi ge hui fu de dui xiang 。
  qing dan 6: cun chu dui xiang shu ju
  # xian zai jiang wen ti cun chu dao shu ju cun chu qi
  foreach my $key (keys %problems)
  {
  $equation-clear;
  $equation-name($key);
  $equation-x($problems{$key}-[0]);
  $equation-y($problems{$key}-[1]);
  $equation-z($problems{$key}-[2]);
  $equation-save;
  }
  wo men qing chu jiu shu xing , she zhi xin shu xing , bing jiang dui xiang cun chu dao shu ju cun chu qi 。 yin wei gang gang qing chu guo shu ju cun chu qi , suo yi wo men zhi dao , bu hui you name jian chong tu , dan shi , tong chang yao jin xing jian cha , yi bian zai yong save fang fa shi tu chong xie xian you jian shi bu hui dao zhi yi chang 。
  qing dan 7: jian suo homework 1 deng shi
  # zai shu ju cun chu qi zhong cha xun homework 1 zhong de deng shi
  $equation-restore_where(qq{name =~ 'Homework 1'});
  while ($equation-restore_next())
  {
  # do something with each equation
  }
  zui hou , bian li shu ju cun chu qi , cha zhao na xie name jian bao han zi fu chuan 'Homework 1' de dui xiang , ran hou dui zhe xie dui xiang zhong de mei yi ge zhi xing cao zuo 。
  zhe ge li zi ben shen bing bu shi ren nan wang , dan shi , qing kao lv :
  xian zai ke yi jiang ren he shu liang de shu xing tian jia dao chi jiu dui xiang
  ke yi you xuan ze di jian suo ren he cun chu de dui xiang
  ren he zhi dao dui xiang shu xing de qi ta cheng xu dou ke yi shi yong tong yang de shu ju cun chu qi ( zhe fang mian de xiang xi xin xi zai “ cong Persistent lei ji cheng ” zhong )。
  tong guo shi yong yu zhi de mo kuai , wo men yi jing yong jian dan de fang fa jie jue le ji shou de wen ti 。 zhe hen you qu 。
  shi yong Persistent::DBI
  qing yue du Persistent::DBI wen dang , lai huo de you guan Persistent::DBI he Persistent::Base lei zhi jian qu bie de zui xin tao lun 。 ji ben shang ,Persistent::DBI yuan xu wo men lian jie dao shu ju ku , bing zai jian li lian jie zhi hou , xiang qi ta Persistent::Base lei na yang cao zuo 。 ke yi jiang qing dan 3 zhong xian shi de dai ma xing yong yi xia ti dai :
  qing dan 8: ding yi yao zuo wei shu ju ku de shu ju cun chu qi
  my $database = 'test_database';
  my $host
  = 'db_host';
  my $user
  = 'dali';
  my $password = 'MeltingClocks';
  my $table
  = 'persistence_test_table';
  my $equation = new Persistent::MySQL(
  "DBI:mysql:database=$database;host=$hostname",
  $user,
  $password,
  $table);
  qing zhu yi ,Persistent::MySQL shi Persistent::DBI de zi lei 。 zhi shi yong Persistent::DBI ben shen mei shen me yong , bi xu shi yong te ding yu wo men shu ju ku de mo kuai 。 ling ren xin wei de shi , chu le tong guo ming cheng lai yin yong Persistent::MySQL zhi wai ( li ru use yu ju he new yu ju ), zai qie huan shu ju ku shi bu xu yao geng gai dai ma 。 you guan tong guo shi yong ji cheng lai jiang cheng xu yu shu ju ku xuan xiang ge li de fang fa , qing shen yue “ cong Persistent lei ji cheng ”。
  qing dan 9: bu tong de cha xun yu fa
  # zai shu ju cun chu qi zhong cha xun homework 1 zhong de deng shi
  $equation-restore_where(qq{name LIKE '%Homework 1%'});
  yin wei xian zai shi yong de shi SQL SELECT yu ju , suo yi restore_where zi bian liang cong Perl mo shi pi pei gai cheng SQL WHERE zi ju 。
  biao bi xu shi xian cun zai ,Persistent::MySQL jiang bu chuang jian biao 。 bian xie yi ge dan du de cheng xu lai chuang jian biao , huo zhe ji cheng shi zai lei zhong tian jia bi xu de gong neng 。
  biao bi xu yu shu xing ding yi pi pei , li ru , deng shi biao de zhu shu ju ku jian bi xu ye shi Persistent lei de zhu jian 。( zhe shi zai shi xian gong zuo zhi qian bi xu you liang hao she ji de qing kuang 。)
  qing dan 8 he qing dan 9 zhi xian shi le wei shi yong SQL er bi xu zai first zhong zuo de geng gai 。 jiao ben second bao han zhe xie geng gai 。
  cong Persistent lei ji cheng
  wen jian Equation.pm bao han cong Persistent::DBI lei ji cheng suo xu de suo you dai ma 。 hen jian dan , bu shi ma ? ji ben shang , zai ben di initialize fang fa zhong zhi xing add_attribute tiao yong 。 zai zhe li huan ke yi zuo geng duo cao zuo : li ru , ru guo shu ju ku zhong bu cun zai biao , ze chuang jian biao 。 dan shi , ji ben fang fa hen jian dan 。
  an quan xing zhu yi shi xiang :
  tong chang , zhi you shu ju ku zhong de te quan yong hu cai neng chuang jian biao , suo yi zui hao yu shu ju ku guan li yuan tao lun biao de chuang jian , yi que bao bu hui yin wei an quan xing ce lue er dao zhi nin xin ku chuang jian de biao wu fa gong zuo 。
  qing dan 10:Equation.pm mo kuai , kuo zhan Persistent::MySQL
  #! /usr/bin/perl -w
  package Equation;
  @ISA = qw(Persistent::MySQL);
  use strict;
  use Persistent::MySQL;
  sub initialize
  {
  my $self = shift;
  $self-SUPER::initialize(@_);
  # define attributes of the object (the contract)
  # this is the primary object identifier key, a 10-character name
  $self-add_attribute('name', 'ID', 'VarChar', undef, 80);
  # x, y, and z are persistent numbers with default values of 0 and length of 10
  【原文】【汉音对照
 
 
 
 
 
 
 
 
 
日版宠物情人插曲《Winding Road》歌词

日版宠物情人2017的插曲,很带节奏感,日语的,女生唱的。 最后听见是在第8集的时候女主手割伤了,然后男主用嘴帮她吸了一下,插曲就出来了。 歌手:Def...

兄弟共妻,我成了他们夜里的美食

老钟家的两个儿子很特别,就是跟其他的人不太一样,魔一般的执着。兄弟俩都到了要结婚的年龄了,不管自家老爹怎么磨破嘴皮子,兄弟俩说不娶就不娶,老父母为兄弟两操碎了心...

如何磨出破洞牛仔裤?牛仔裤怎么剪破洞?

把牛仔裤磨出有线的破洞 1、具体工具就是磨脚石,下面垫一个硬物,然后用磨脚石一直磨一直磨,到把那块磨薄了,用手撕开就好了。出来的洞啊很自然的。需要猫须的话调几...

我就是扫描下图得到了敬业福和爱国福

先来看下敬业福和爱国福 今年春节,支付宝再次推出了“五福红包”活动,表示要“把欠大家的敬业福都还给大家”。 今天该活动正式启动,和去年一样,需要收集“五福”...

冰箱异味产生的原因和臭味去除的方法

有时候我们打开冰箱就会闻到一股异味,冰箱里的这种异味是因为一些物质发出的气味的混合体,闻起来让人恶心。 产生这些异味的主要原因有以下几点。 1、很多人有这种习...

 
 
   shu ju cun chu shi ji suan ji bian cheng zhong chang jian de wen ti 。CPAN Persistent lei tong guo yi ge jian hua shu ju chuang jian 、 jian suo he guan li de tong yong jie kou , shi shu ju cun chu bian de jian dan 。 tong guo mian xiang dui xiang de fang fa , ke yi zai xiang mu zhong jiang Persistent lei zuo wei zi ji de shu ju lei de fu lei tou ming di shi yong 。    chi jiu xing jie shao    suo you cheng xu yuan dou you bi xu jie jue shu ju chi jiu xing wen ti de jing li 。 li ru , dui yu ru jiang wen dang cun ru wen jian he jiang shi wu cun ru shu ju ku deng ren wu , ji shi zui jian dan de ying yong cheng xu ye xu yao da liang gong zuo 。 ke yi jiang shu ju chi jiu xing ding yi wei cheng xu he cun chu she bei zhi jian da cheng de qi yue , gai qi yue zhi ding ru he cun chu he jian suo shu ju 。   CPAN ding yi :   “CPAN shi zong he Perl dang an wang luo 。 zong he : qi mu de shi bao han ke neng xu yao de suo you Perl zi liao 。 dang an : cong 1999 nian 9 yue zhi jin , yi you 760 zhao zi jie 。 wang luo : quan shi jie you chao guo yi bai ge CPAN jing xiang zhan dian 。”    ben wen ji zhong jiang shu zai zuo zhe he du zhe shi xian dou zhi dao dui xiang shu xing de qing kuang xia , ru he shi dui xiang shu xing chi jiu 。 ben wen bu tao lun dong tai fa xian dui xiang shu xing he cun chu shu xing yi wai de te xing ( ru xing wei ) de zhu ti , yin wei xu yao hen duo pian fu cai neng ba zhe xie zhu ti jiang qing chu 。    shu xi mian xiang dui xiang bian cheng 、 shu ju ku 、Perl he Perl ji cheng jiang dui yue du ben wen you bang zhu 。    shi dui xiang shu xing chi jiu zhi shi ruan jian kai fa guo cheng de yi xiao bu fen 。 shou xian , bi xu que ding chi jiu xing de xu qiu 。 xu yao bao cun shen me ? xu yao hui fu shen me ? zai hui fu cun chu de shu ju zhi qian , xu yao shou gong bian ji ma ? zhu ru ci lei de wen ti jiang que ding ruan jian ru he jiang chi jiu shu ju gui dang 。 bu xing di shi , mei you yi fen tiao cha biao ke yi que ding xiang mu que qie de chi jiu xing xu yao 。 ruan jian she ji shi bi xu tong guo zhi neng she ji , ding yi bing man zu xiang mu xu qiu 。 hen chong yao de yi dian shi , zui hou de jie jue fang an yao que shi shi wen ti de jie jue fang an , er bu zhi shi shi mao de xing ye ci yu 。 li ru ,XML jie jue shu ju chi jiu xing wen ti de neng li bi zhi yong zhuan tou lai jian zao fang wu hao bu dao na li 。    chi jiu shu ju shi li   Perl wen jian simple xian shi le yu ding yi de guan jian zi ji he ru he neng gou shi xian jian dan de chi jiu xing 。 zhe zhong fang fa you hen duo wen ti : wen jian ge shi shi ren yi de , zhi bao cun yi ge guan jian zi ji he , gen ben mei you dui xiang 、 shu ju zhi xian zhi dao yi xing wen ben deng deng 。   Persistent lei de jian dan shi yong :Persistent::File   Persistent lei zhi zai shi shu ju chi jiu xing bian de jian dan 。 wei ci , nin bi xu yue du wen dang 。 dui yu zhang wo chu li chi jiu shu ju de fang bian de yu zhi lei er yan , zhe zhi shi hen xiao de dai jia 。 suo yi , xian hua shang ji fen zhong huo ji xiao shi lai zuo zhe jian shi , yi hou jiang jie sheng nin de shi jian 。 you guan wen dang he shi li , qing shen yue Persistent lei zhu ye ( qing shen yue shen kao zi liao )。    di yi ge shi li first jiang ji yu Persistent::File mo kuai wen dang zhong gei chu de simple shi li , bing jiang miao shu da dao chi jiu xing de bu zhou 。    qing dan 1: ding yi shu ju   my %problems = (   'Homework 1, Problem 1' = [0,5,2],   'Homework 1, Problem 2' = [1,8,5],   'Homework 1, Problem 3' = [2,2,4],   'Homework 1, Problem 4' = [3,0,3],   'Homework 1, Problem 5' = [4,1,2],   );    shou xian , ding yi yao cun chu zai shu ju cun chu qi zhong de shu ju 。 zai Persistent lei zhong , shu ju cun chu qi shi chou xiang cun chu she bei , li ru , ta ke yi shi wen jian huo shu ju ku 。 gai li shi zi bao rong de , dan shi shu ju ye ke neng lai zi bie chu 。    qing dan 2: shi yong eval lai bu huo cuo wu   use English;   eval   {   };   print "An error occurred: $EVAL_ERROR\n" if $EVAL_ERROR;    yin wei bu xi wang cheng xu zai chu xian zhi xing cuo wu shi zhong zhi , suo yi jiang suo you cao zuo fang zai eval yu ju zhong 。English mo kuai shi wo men ke yi shi yong $EVAL_ERROR 、 er bu shi $@ lai biao shi cuo wu xiao xi 。    qing dan 3: ding yi shu ju cun chu qi   # cong wen jian chuang jian chi jiu dui xiang   my $equation = new Persistent::File('variables.txt');    wo men zai zhe li chuang jian le xin de Persistent::File dui xiang , qi nei rong jiang cun chu zai wen jian variables.txt zhong 。    qing dan 4: ding yi shu xing   $equation-add_attribute('name', 'ID', 'VarChar', undef, 80);   $equation-add_attribute('x', 'Persistent', 'Number', 0, 10);   $equation-add_attribute('y', 'Persistent', 'Number', 0, 10);   $equation-add_attribute('z', 'Persistent', 'Number', 0, 10);   $equation-add_attribute('answer', 'Transient', 'Number', undef, 10);    wo men chuang jian le wu ge shu xing : yi ge wei yi biao shi 、 san ge chi jiu shu ju cheng yuan he yi ge fei chi jiu ( zan shi ) shu ju cheng yuan 。Persistent lei jiang zi dong chuang jian bi yao de han shu ( li ru ,$equation-answer()) lai fang wen shu ju cheng yuan 。    qing dan 5: qing chu shu ju cun chu qi   $equation-restore_all();   $equation-delete while $equation-restore_next();   restore_all fang fa jian suo zheng ge shu ju cun chu qi de nei rong 。restore_where he restore fang fa fen bie yong lai xuan ze fu he mou xie biao zhun de dui xiang he dan yi dui xiang 。delete fang fa chu qu dang qian deng shi ,restore_next fang fa yi zhi xia yi ge hui fu de dui xiang 。    qing dan 6: cun chu dui xiang shu ju   # xian zai jiang wen ti cun chu dao shu ju cun chu qi   foreach my $key (keys %problems)   {   $equation-clear;   $equation-name($key);   $equation-x($problems{$key}-[0]);   $equation-y($problems{$key}-[1]);   $equation-z($problems{$key}-[2]);   $equation-save;   }    wo men qing chu jiu shu xing , she zhi xin shu xing , bing jiang dui xiang cun chu dao shu ju cun chu qi 。 yin wei gang gang qing chu guo shu ju cun chu qi , suo yi wo men zhi dao , bu hui you name jian chong tu , dan shi , tong chang yao jin xing jian cha , yi bian zai yong save fang fa shi tu chong xie xian you jian shi bu hui dao zhi yi chang 。    qing dan 7: jian suo homework 1 deng shi   # zai shu ju cun chu qi zhong cha xun homework 1 zhong de deng shi   $equation-restore_where(qq{name =~ 'Homework 1'});   while ($equation-restore_next())   {   # do something with each equation   }    zui hou , bian li shu ju cun chu qi , cha zhao na xie name jian bao han zi fu chuan 'Homework 1' de dui xiang , ran hou dui zhe xie dui xiang zhong de mei yi ge zhi xing cao zuo 。    zhe ge li zi ben shen bing bu shi ren nan wang , dan shi , qing kao lv :    xian zai ke yi jiang ren he shu liang de shu xing tian jia dao chi jiu dui xiang    ke yi you xuan ze di jian suo ren he cun chu de dui xiang    ren he zhi dao dui xiang shu xing de qi ta cheng xu dou ke yi shi yong tong yang de shu ju cun chu qi ( zhe fang mian de xiang xi xin xi zai “ cong Persistent lei ji cheng ” zhong )。    tong guo shi yong yu zhi de mo kuai , wo men yi jing yong jian dan de fang fa jie jue le ji shou de wen ti 。 zhe hen you qu 。    shi yong Persistent::DBI    qing yue du Persistent::DBI wen dang , lai huo de you guan Persistent::DBI he Persistent::Base lei zhi jian qu bie de zui xin tao lun 。 ji ben shang ,Persistent::DBI yuan xu wo men lian jie dao shu ju ku , bing zai jian li lian jie zhi hou , xiang qi ta Persistent::Base lei na yang cao zuo 。 ke yi jiang qing dan 3 zhong xian shi de dai ma xing yong yi xia ti dai :    qing dan 8: ding yi yao zuo wei shu ju ku de shu ju cun chu qi   my $database = 'test_database';   my $host   = 'db_host';   my $user   = 'dali';   my $password = 'MeltingClocks';   my $table   = 'persistence_test_table';   my $equation = new Persistent::MySQL(   "DBI:mysql:database=$database;host=$hostname",   $user,   $password,   $table);    qing zhu yi ,Persistent::MySQL shi Persistent::DBI de zi lei 。 zhi shi yong Persistent::DBI ben shen mei shen me yong , bi xu shi yong te ding yu wo men shu ju ku de mo kuai 。 ling ren xin wei de shi , chu le tong guo ming cheng lai yin yong Persistent::MySQL zhi wai ( li ru use yu ju he new yu ju ), zai qie huan shu ju ku shi bu xu yao geng gai dai ma 。 you guan tong guo shi yong ji cheng lai jiang cheng xu yu shu ju ku xuan xiang ge li de fang fa , qing shen yue “ cong Persistent lei ji cheng ”。    qing dan 9: bu tong de cha xun yu fa   # zai shu ju cun chu qi zhong cha xun homework 1 zhong de deng shi   $equation-restore_where(qq{name LIKE '%Homework 1%'});    yin wei xian zai shi yong de shi SQL SELECT yu ju , suo yi restore_where zi bian liang cong Perl mo shi pi pei gai cheng SQL WHERE zi ju 。    biao bi xu shi xian cun zai ,Persistent::MySQL jiang bu chuang jian biao 。 bian xie yi ge dan du de cheng xu lai chuang jian biao , huo zhe ji cheng shi zai lei zhong tian jia bi xu de gong neng 。    biao bi xu yu shu xing ding yi pi pei , li ru , deng shi biao de zhu shu ju ku jian bi xu ye shi Persistent lei de zhu jian 。( zhe shi zai shi xian gong zuo zhi qian bi xu you liang hao she ji de qing kuang 。)    qing dan 8 he qing dan 9 zhi xian shi le wei shi yong SQL er bi xu zai first zhong zuo de geng gai 。 jiao ben second bao han zhe xie geng gai 。    cong Persistent lei ji cheng    wen jian Equation.pm bao han cong Persistent::DBI lei ji cheng suo xu de suo you dai ma 。 hen jian dan , bu shi ma ? ji ben shang , zai ben di initialize fang fa zhong zhi xing add_attribute tiao yong 。 zai zhe li huan ke yi zuo geng duo cao zuo : li ru , ru guo shu ju ku zhong bu cun zai biao , ze chuang jian biao 。 dan shi , ji ben fang fa hen jian dan 。    an quan xing zhu yi shi xiang :    tong chang , zhi you shu ju ku zhong de te quan yong hu cai neng chuang jian biao , suo yi zui hao yu shu ju ku guan li yuan tao lun biao de chuang jian , yi que bao bu hui yin wei an quan xing ce lue er dao zhi nin xin ku chuang jian de biao wu fa gong zuo 。    qing dan 10:Equation.pm mo kuai , kuo zhan Persistent::MySQL   #! /usr/bin/perl -w   package Equation;   @ISA = qw(Persistent::MySQL);   use strict;   use Persistent::MySQL;   sub initialize   {   my $self = shift;   $self-SUPER::initialize(@_);   # define attributes of the object (the contract)   # this is the primary object identifier key, a 10-character name   $self-add_attribute('name', 'ID', 'VarChar', undef, 80);   # x, y, and z are persistent numbers with default values of 0 and length of 10   
󰈣󰈤
  免责声明:本文仅代表作者个人观点,与王朝网络无关。王朝网络登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述,其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
 
清凉一夏_清纯美丽
纯白色小礼服
靓丽可人儿_嘉嘉
我的女神_靓丽女生
主题摄影
贵州,让我欢喜,让我神伤。
莫干山
天平秋色
 
>>返回首页<<
 
 
 为你推荐
 
 
 
 转载本文
 UBB代码 HTML代码
复制到剪贴板...
 
 热帖排行
 
 
 
 
 
©2005- 王朝网络 版权所有