亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? db_file.pm

?? linux 下的源代碼分析閱讀器 red hat公司新版
?? PM
?? 第 1 頁 / 共 5 頁
字號:
    use DB_File ;    my $filename = "text" ;    unlink $filename ;    my @h ;    tie @h, "DB_File", $filename, O_RDWR|O_CREAT, 0666, $DB_RECNO         or die "Cannot open file 'text': $!\n" ;    # Add a few key/value pairs to the file    $h[0] = "orange" ;    $h[1] = "blue" ;    $h[2] = "yellow" ;    push @h, "green", "black" ;    my $elements = scalar @h ;    print "The array contains $elements entries\n" ;    my $last = pop @h ;    print "popped $last\n" ;    unshift @h, "white" ;    my $first = shift @h ;    print "shifted $first\n" ;    # Check for existence of a key    print "Element 1 Exists with value $h[1]\n" if $h[1] ;    # use a negative index    print "The last element is $h[-1]\n" ;    print "The 2nd last element is $h[-2]\n" ;    untie @h ;Here is the output from the script:    The array contains 5 entries    popped black    shifted white    Element 1 Exists with value blue    The last element is green    The 2nd last element is yellow=head2 Extra RECNO MethodsIf you are using a version of Perl earlier than 5.004_57, the tiedarray interface is quite limited. In the example script aboveC<push>, C<pop>, C<shift>, C<unshift>or determining the array length will not work with a tied array.To make the interface more useful for older versions of Perl, a numberof methods are supplied with B<DB_File> to simulate the missing arrayoperations. All these methods are accessed via the object returned fromthe tie call.Here are the methods:=over 5=item B<$X-E<gt>push(list) ;>Pushes the elements of C<list> to the end of the array.=item B<$value = $X-E<gt>pop ;>Removes and returns the last element of the array.=item B<$X-E<gt>shift>Removes and returns the first element of the array.=item B<$X-E<gt>unshift(list) ;>Pushes the elements of C<list> to the start of the array.=item B<$X-E<gt>length>Returns the number of elements in the array.=item B<$X-E<gt>splice(offset, length, elements);>Returns a splice of the array.=back=head2 Another ExampleHere is a more complete example that makes use of some of the methodsdescribed above. It also makes use of the API interface directly (see L<THE API INTERFACE>).    use warnings ;    use strict ;    my (@h, $H, $file, $i) ;    use DB_File ;    use Fcntl ;    $file = "text" ;    unlink $file ;    $H = tie @h, "DB_File", $file, O_RDWR|O_CREAT, 0666, $DB_RECNO         or die "Cannot open file $file: $!\n" ;    # first create a text file to play with    $h[0] = "zero" ;    $h[1] = "one" ;    $h[2] = "two" ;    $h[3] = "three" ;    $h[4] = "four" ;    # Print the records in order.    #    # The length method is needed here because evaluating a tied    # array in a scalar context does not return the number of    # elements in the array.      print "\nORIGINAL\n" ;    foreach $i (0 .. $H->length - 1) {        print "$i: $h[$i]\n" ;    }    # use the push & pop methods    $a = $H->pop ;    $H->push("last") ;    print "\nThe last record was [$a]\n" ;    # and the shift & unshift methods    $a = $H->shift ;    $H->unshift("first") ;    print "The first record was [$a]\n" ;    # Use the API to add a new record after record 2.    $i = 2 ;    $H->put($i, "Newbie", R_IAFTER) ;    # and a new record before record 1.    $i = 1 ;    $H->put($i, "New One", R_IBEFORE) ;    # delete record 3    $H->del(3) ;    # now print the records in reverse order    print "\nREVERSE\n" ;    for ($i = $H->length - 1 ; $i >= 0 ; -- $i)      { print "$i: $h[$i]\n" }    # same again, but use the API functions instead    print "\nREVERSE again\n" ;    my ($s, $k, $v)  = (0, 0, 0) ;    for ($s = $H->seq($k, $v, R_LAST) ;              $s == 0 ;              $s = $H->seq($k, $v, R_PREV))      { print "$k: $v\n" }    undef $H ;    untie @h ;and this is what it outputs:    ORIGINAL    0: zero    1: one    2: two    3: three    4: four    The last record was [four]    The first record was [zero]    REVERSE    5: last    4: three    3: Newbie    2: one    1: New One    0: first    REVERSE again    5: last    4: three    3: Newbie    2: one    1: New One    0: firstNotes:=over 5=item 1.Rather than iterating through the array, C<@h> like this:    foreach $i (@h)it is necessary to use either this:    foreach $i (0 .. $H->length - 1) or this:    for ($a = $H->get($k, $v, R_FIRST) ;         $a == 0 ;         $a = $H->get($k, $v, R_NEXT) )=item 2.Notice that both times the C<put> method was used the record index wasspecified using a variable, C<$i>, rather than the literal valueitself. This is because C<put> will return the record number of theinserted line via that parameter.=back=head1 THE API INTERFACEAs well as accessing Berkeley DB using a tied hash or array, it is alsopossible to make direct use of most of the API functions defined in theBerkeley DB documentation.To do this you need to store a copy of the object returned from the tie.	$db = tie %hash, "DB_File", "filename" ;Once you have done that, you can access the Berkeley DB API functionsas B<DB_File> methods directly like this:	$db->put($key, $value, R_NOOVERWRITE) ;B<Important:> If you have saved a copy of the object returned fromC<tie>, the underlying database file will I<not> be closed until boththe tied variable is untied and all copies of the saved object aredestroyed.     use DB_File ;    $db = tie %hash, "DB_File", "filename"         or die "Cannot tie filename: $!" ;    ...    undef $db ;    untie %hash ;See L<The untie() Gotcha> for more details.All the functions defined in L<dbopen> are available except forclose() and dbopen() itself. The B<DB_File> method interface to thesupported functions have been implemented to mirror the way Berkeley DBworks whenever possible. In particular note that:=over 5=item *The methods return a status value. All return 0 on success.All return -1 to signify an error and set C<$!> to the exacterror code. The return code 1 generally (but not always) means that thekey specified did not exist in the database.Other return codes are defined. See below and in the Berkeley DBdocumentation for details. The Berkeley DB documentation should be usedas the definitive source.=item *Whenever a Berkeley DB function returns data via one of its parameters,the equivalent B<DB_File> method does exactly the same.=item *If you are careful, it is possible to mix API calls with the tiedhash/array interface in the same piece of code. Although only a few ofthe methods used to implement the tied interface currently make use ofthe cursor, you should always assume that the cursor has been changedany time the tied hash/array interface is used. As an example, thiscode will probably not do what you expect:    $X = tie %x, 'DB_File', $filename, O_RDWR|O_CREAT, 0777, $DB_BTREE        or die "Cannot tie $filename: $!" ;    # Get the first key/value pair and set  the cursor    $X->seq($key, $value, R_FIRST) ;    # this line will modify the cursor    $count = scalar keys %x ;     # Get the second key/value pair.    # oops, it didn't, it got the last key/value pair!    $X->seq($key, $value, R_NEXT) ;The code above can be rearranged to get around the problem, like this:    $X = tie %x, 'DB_File', $filename, O_RDWR|O_CREAT, 0777, $DB_BTREE        or die "Cannot tie $filename: $!" ;    # this line will modify the cursor    $count = scalar keys %x ;     # Get the first key/value pair and set  the cursor    $X->seq($key, $value, R_FIRST) ;    # Get the second key/value pair.    # worked this time.    $X->seq($key, $value, R_NEXT) ;=backAll the constants defined in L<dbopen> for use in the flags parametersin the methods defined below are also available. Refer to the BerkeleyDB documentation for the precise meaning of the flags values.Below is a list of the methods available.=over 5=item B<$status = $X-E<gt>get($key, $value [, $flags]) ;>Given a key (C<$key>) this method reads the value associated with itfrom the database. The value read from the database is returned in theC<$value> parameter.If the key does not exist the method returns 1.No flags are currently defined for this method.=item B<$status = $X-E<gt>put($key, $value [, $flags]) ;>Stores the key/value pair in the database.If you use either the R_IAFTER or R_IBEFORE flags, the C<$key> parameterwill have the record number of the inserted key/value pair set.Valid flags are R_CURSOR, R_IAFTER, R_IBEFORE, R_NOOVERWRITE andR_SETCURSOR.=item B<$status = $X-E<gt>del($key [, $flags]) ;>Removes all key/value pairs with key C<$key> from the database.A return code of 1 means that the requested key was not in thedatabase.R_CURSOR is the only valid flag at present.=item B<$status = $X-E<gt>fd ;>Returns the file descriptor for the underlying database.See L<Locking: The Trouble with fd> for an explanation for why you shouldnot use C<fd> to lock your database.=item B<$status = $X-E<gt>seq($key, $value, $flags) ;>This interface allows sequential retrieval from the database. SeeL<dbopen> for full details.Both the C<$key> and C<$value> parameters will be set to the key/valuepair read from the database.The flags parameter is mandatory. The valid flag values are R_CURSOR,R_FIRST, R_LAST, R_NEXT and R_PREV.=item B<$status = $X-E<gt>sync([$flags]) ;>Flushes any cached buffers to disk.R_RECNOSYNC is the only valid flag at present.=back=head1 DBM FILTERSA DBM Filter is a piece of code that is be used when you I<always>want to make the same transformation to all keys and/or values in aDBM database.There are four methods associated with DBM Filters. All work identically,and each is used to install (or uninstall) a single DBM Filter. Eachexpects a single parameter, namely a reference to a sub. The onlydifference between them is the place that the filter is installed.To summarise:=over 5=item B<filter_store_key>If a filter has been installed with this method, it will be invokedevery time you write a key to a DBM database.=item B<filter_store_value>If a filter has been installed with this method, it will be invokedevery time you write a value to a DBM database.=item B<filter_fetch_key>If a filter has been installed with this method, it will be invokedevery time you read a key from a DBM database.=item B<filter_fetch_value>If a filter has been installed with this method, it will be invokedevery time you read a value from a DBM database.=backYou can use any combination of the methods, from none, to all four.All filter methods return the existing filter, if present, or C<undef>in not.To delete a filter pass C<undef> to it.=head2 The FilterWhen each filter is called by Perl, a local copy of C<$_> will containthe key or value to be filtered. Filtering is achieved by modifyingthe contents of C<$_>. The return code from the filter is ignored.=head2 An Example -- the NULL termination problem.Consider the following scenario. You have a DBM databasethat you need to share with a third-party C application. The C applicationassumes that I<all> keys and values are NULL terminated. Unfortunatelywhen Perl writes to DBM databases it doesn't use NULL termination, soyour Perl application will have to manage NULL termination itself. Whenyou write to the database you will have to use something like this:    $hash{"$key\0"} = "$value\0" ;Similarly the NULL needs to be taken into account when you are consideringthe length of existing keys/values.It would be much better if you could ignore the NULL terminations issuein the main application code and have a mechanism that automaticallyadded the terminating NULL to all keys and values whenever you write tothe database and have them removed when you read from the database. As I'msure you have already guessed, this is a problem that DBM Filters canfix very easily.    use warnings ;    use strict ;    use DB_File ;    my %hash ;    my $filename = "filt" ;    unlink $filename ;    my $db = tie %hash, 'DB_File', $filename, O_CREAT|O_RDWR, 0666, $DB_HASH       or die "Cannot open $filename: $!\n" ;    # Install DBM Filters    $db->filter_fetch_key  ( sub { s/\0$//    } ) ;    $db->filter_store_key  ( sub { $_ .= "\0" } ) ;    $db->filter_fetch_value( sub { s/\0$//    } ) ;    $db->filter_store_value( sub { $_ .= "\0" } ) ;

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美伊人久久大香线蕉综合69 | 国产成人综合视频| 亚洲人一二三区| 精品日韩一区二区三区免费视频| 91麻豆成人久久精品二区三区| 久久99九九99精品| 日精品一区二区| 一区二区三区毛片| 国产欧美精品在线观看| 日韩欧美成人激情| 欧美日韩aaaaaa| 色一情一乱一乱一91av| 丁香亚洲综合激情啪啪综合| 精品在线视频一区| 美女网站一区二区| 午夜精品123| 亚洲一区二区精品3399| 亚洲视频免费看| 国产精品伦理一区二区| 久久久影视传媒| 日韩免费性生活视频播放| 欧美老年两性高潮| 欧美一a一片一级一片| 色伊人久久综合中文字幕| 99亚偷拍自图区亚洲| 国产不卡一区视频| 国产一区二区毛片| 国产精品夜夜嗨| 韩国视频一区二区| 国产一区二区导航在线播放| 成人少妇影院yyyy| 国产精品亚洲成人| 国产成人鲁色资源国产91色综 | 337p粉嫩大胆色噜噜噜噜亚洲| 欧美日韩一区二区三区四区五区| 91论坛在线播放| 91免费版pro下载短视频| 色呦呦国产精品| 在线免费观看一区| 欧美日韩亚洲综合| 7777精品久久久大香线蕉 | 欧美日韩国产精品自在自线| 色综合久久99| 日本精品一区二区三区高清| 在线看国产一区| 日本韩国欧美一区二区三区| 色综合av在线| 欧美亚洲国产一区在线观看网站| 色欧美片视频在线观看| 欧美视频一二三区| 欧美精品自拍偷拍动漫精品| 日韩欧美一区二区在线视频| 欧美理论在线播放| 日韩欧美综合一区| 久久这里只精品最新地址| 国产女人18水真多18精品一级做| 欧美激情一区二区三区全黄| 国产精品成人网| 一区二区高清在线| 男人的天堂亚洲一区| 黄网站免费久久| 不卡区在线中文字幕| 欧美伊人久久大香线蕉综合69| 欧美日韩国产一区二区三区地区| 欧美一级一区二区| 精品国产不卡一区二区三区| 国产亚洲va综合人人澡精品| 亚洲视频1区2区| 日本vs亚洲vs韩国一区三区 | 国产成人自拍网| 91污片在线观看| 欧美日韩一区二区三区在线| 日韩欧美在线不卡| 亚洲美女视频一区| 亚洲国产裸拍裸体视频在线观看乱了 | 91麻豆文化传媒在线观看| 欧美日韩国产电影| 久久精品亚洲乱码伦伦中文| 伊人色综合久久天天人手人婷| 日韩电影一区二区三区四区| 国产a级毛片一区| 欧美日韩一区二区三区在线| 久久久亚洲高清| 一区二区三区电影在线播| 麻豆一区二区在线| 99国产精品久久久| 日韩久久精品一区| 亚洲精品乱码久久久久久久久| 青青青伊人色综合久久| 国产成人激情av| 欧美日韩夫妻久久| 国产日韩亚洲欧美综合| 图片区小说区国产精品视频| 精品一区免费av| 91蜜桃传媒精品久久久一区二区| 欧美一级高清大全免费观看| 国产精品高潮呻吟| 精彩视频一区二区三区| 欧美亚洲国产一区在线观看网站 | 欧美高清www午色夜在线视频| 国产欧美日韩视频在线观看| 午夜在线成人av| 91在线小视频| 久久亚洲精华国产精华液| 午夜精品福利一区二区三区蜜桃| 国产69精品久久99不卡| 日韩视频永久免费| 亚洲自拍偷拍av| 丁香一区二区三区| 久久综合久久综合亚洲| 日产欧产美韩系列久久99| 欧美色电影在线| 亚洲色图.com| 成人午夜视频网站| 久久久久久免费| 国产综合久久久久影院| 国产目拍亚洲精品99久久精品| 日韩精品一级中文字幕精品视频免费观看 | 欧美成人精品1314www| 午夜欧美视频在线观看| 91久久精品网| 亚洲日本青草视频在线怡红院| 国产一区不卡在线| 欧美xfplay| 久久99久国产精品黄毛片色诱| 日韩欧美成人午夜| 卡一卡二国产精品| 欧美一卡在线观看| 看电视剧不卡顿的网站| 精品久久一区二区| 全部av―极品视觉盛宴亚洲| 91精品综合久久久久久| 三级精品在线观看| 欧美男男青年gay1069videost | 亚洲精品国产品国语在线app| av网站免费线看精品| 91精品国产麻豆国产自产在线 | 色婷婷精品久久二区二区蜜臂av| 国产肉丝袜一区二区| 成人午夜激情视频| 中文字幕中文字幕一区二区| 懂色av一区二区三区蜜臀| 国产精品理论片在线观看| 成人精品免费看| 亚洲品质自拍视频网站| 91激情五月电影| 婷婷开心激情综合| 日韩视频不卡中文| 国模冰冰炮一区二区| 国产免费成人在线视频| 99久久婷婷国产综合精品电影| 亚洲人成小说网站色在线| 91在线观看地址| 亚洲欧美一区二区视频| 欧美在线免费视屏| 美女高潮久久久| 国产精品热久久久久夜色精品三区| 日韩欧美一级二级三级久久久| 美国精品在线观看| 国产欧美日韩另类一区| jiyouzz国产精品久久| 亚洲成人综合在线| 91麻豆精品国产91久久久久久久久| 久久99精品国产麻豆婷婷| 久久日韩精品一区二区五区| 国产黄人亚洲片| 一区二区三区欧美日| 欧美精品日日鲁夜夜添| 韩国欧美国产一区| 亚洲视频你懂的| 欧美成人高清电影在线| 国产v综合v亚洲欧| 亚洲va天堂va国产va久| 欧美国产欧美综合| 欧美日韩亚洲综合在线 | 国产综合成人久久大片91| 1024亚洲合集| 91精品国产欧美一区二区18| 国产在线不卡视频| 亚洲三级理论片| 日韩你懂的在线播放| 91视频91自| 精品一区二区三区蜜桃| 中文字幕佐山爱一区二区免费| 欧美日本一区二区三区| 国产一区二区三区免费观看| 亚洲一区在线视频| 国产丝袜美腿一区二区三区| 精品视频123区在线观看| 成人av中文字幕| 日本不卡高清视频| 亚洲男女一区二区三区| 精品国精品自拍自在线| 欧美性受xxxx黑人xyx| 国产做a爰片久久毛片| 亚洲国产你懂的| 中文字幕一区二区三区视频| 在线播放国产精品二区一二区四区| 久久精品99国产精品| 亚洲欧美另类图片小说|