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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? rhl29.htm

?? linux的初學電子書
?? HTM
?? 第 1 頁 / 共 5 頁
字號:

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Opens test.data for reading. File must exist.</FONT>

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

&quot;&lt;test.data&quot;

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Opens test.data for reading. File must exist.</FONT>

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

&quot;&gt;test.data&quot;

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Opens test.data for writing. Creates file if it does not exist. Appends to any existing file called test.data.</FONT>

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

&quot;+&gt;test.data&quot;

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Opens test.data for reading and writing. Creates file if it does not exist.</FONT>

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

&quot;+&lt;test.data&quot;

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Opens test.data for reading and writing. Creates file if it does not exist. Preferred way in Perl 5.</FONT>

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

&quot;| cmd&quot; 

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Opens a pipe to write to.</FONT>

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

&quot;cmd |&quot; 

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Opens a pipe to read from.</FONT>

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

&quot;-&quot;

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Opens STDIN.</FONT>

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

&quot;&gt;-&quot;

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Opens STDOUT.</FONT>

</TABLE><P>When working with multiple files, you can have more than one unique handle to write to or read from. Use the select HANDLE; call to set the default file handle to use when using print statements. For example, say you have two file handles, LARRY 
and CURLY. Here's how to switch between handles:

<BR>

<PRE>

<FONT COLOR="#000080">select LARRY;

print &quot;Whatsssa matter?\n&quot;; # write to LARRY

select CURLY;

print &quot;Whoop, whoop, whoop!&quot;; # write to CURLY

select LARRY;

print &quot;I oughta.... &quot;; # write to LARRY again</FONT></PRE>

<P>Of course, by explicitly stating the handle name you could get the same result with these three lines of code:

<BR>

<PRE>

<FONT COLOR="#000080">print LARRY &quot;Whatsssa matter?\n&quot;; # write to LARRY

print CURLY &quot;Whoop, whoop, whoop!&quot;; # write to CURLY

print LARRY &quot;I oughta.... &quot;; # write to LARRY again</FONT></PRE>

<P>This is a very brief introduction to using file handles in Perl. The use of file handles is covered throughout the rest of the book, so don't worry if this pace of information is too quick. You will see plenty of examples throughout the book.

<BR>

<P>You can also check for the status of a file given a filename. The available tests are listed in the source test file in Listing 29.7.

<BR>

<P>

<FONT COLOR="#000080"><B>Listing 29.7. Testing file parameters.</B></FONT>

<BR>

<PRE>

<FONT COLOR="#000080">#!/usr/bin/perl

$name = &quot;test.txt&quot;;

print &quot;\nTesting flags for $name \n&quot;;

print &quot;\n========== Effective User ID tests &quot;;

print &quot;\n is readable&quot; if ( -r $name);

print &quot;\n is writeable&quot; if ( -w $name);

print &quot;\n is executeable&quot; if ( -x $name);

print &quot;\n is owned &quot; if ( -o $name);

print &quot;\n========== Real User ID tests &quot;;

print &quot;\n is readable&quot; if ( -R $name);

print &quot;\n is writeable&quot; if ( -W $name);

print &quot;\n is executeable&quot; if ( -X $name);

print &quot;\n is owned &quot; if ( -O $name);

print &quot;\n========== Reality Checks &quot;;

print &quot;\n exists &quot; if ( -e $name);

print &quot;\n has zero size &quot; if ( -z $name);

print &quot;\n has some bytes in it &quot; if ( -s $name);

print &quot;\n is a file &quot; if (-f $name);

print &quot;\n is a directory &quot; if (-d $name);

print &quot;\n is a link &quot; if (-l $name);

print &quot;\n is a socket &quot; if (-S $name);

print &quot;\n is a pipe &quot; if (-p $name);

print &quot;\n is a block device &quot; if (-b $name);

print &quot;\n is a character device &quot; if (-c $name);

print &quot;\n has setuid bit set &quot; if (-u $name);

print &quot;\n has sticky bit set &quot; if (-k $name);

print &quot;\n has gid bit set &quot; if (-g $name);

print &quot;\n is open to terminal &quot; if (-t $name);

print &quot;\n is a Binary file &quot; if (-B $name);

print &quot;\n is a Text file &quot; if (-T $name);

print &quot;\n is Binary to terminal &quot; if (-t $name);

print &quot;\n is open to terminal &quot; if (-t $name);

print &quot;\n age of file is &quot;.(int(-M $name)+1).&quot; day(s) old&quot; if (-e $name);print &quot;\n access time of file is &quot;.(-A $name) if (-e $name);

print &quot;\n inode change time of file is &quot;.(-C $name) if (-e $name);

printf &quot;\n&quot;;</FONT></PRE>

<BR>

<A NAME="E68E234"></A>

<H3 ALIGN=CENTER>

<CENTER>

<FONT SIZE=5 COLOR="#FF0000"><B>Working with Patterns</B></FONT></CENTER></H3>

<BR>

<P>Perl has a very powerful regular expression parser and string search and replace functions. To search for a substring, you would use the following syntax normally within an if block:

<BR>

<PRE>

<FONT COLOR="#000080">if ($a =~ /menu/) {

printf &quot;\n Found menu in $a! \n&quot;;

}</FONT></PRE>

<P>The value in $a is the number of matched strings. To search in a case-insensitive manner, use an 'i' at the end of the search statement like this:

<BR>

<PRE>

<FONT COLOR="#000080">if ($a =~ /mEnU/i) {

printf &quot;\n Found menu in $a! \n&quot;;

}</FONT></PRE>

<P>You can even search for items in an array. For example, if $a was an array @a, then the returned value from the search operation will be an array with all the matched strings. If you do not specify the &quot;@a =~&quot; portion, then Perl will use the 
$_ default name space to search on.

<BR>

<P>To search and replace strings, use the following syntax:

<BR>

<BR>

<PRE>

<FONT COLOR="#000080">$expr =~ s/old/new/gie</FONT></PRE>

<P>The 'g', 'i', and 'e' are optional parameters. If the 'g' is not specified, only the first match to the &quot;old&quot; string will be replaced with &quot;new.&quot; The 'i' flag specifies a case-insensitive search. The 'e' forces Perl to use the 
&quot;new&quot; string as a Perl expression. So, in the following example, the value of $a will be &quot;HIGHWAY&quot;:

<BR>

<PRE>

<FONT COLOR="#000080">$a = &quot;DRIVEWAY&quot;;

$a =~ s/HIGH/DRIVE/

print $a;</FONT></PRE>

<P>Perl has a grep() function very similar to the grep function in UNIX, Perl's grep function takes a regular expression and a list. The return value from grep can be handled one of two ways: if assigned to a scalar, it is the number of matches found, and 
if assigned to a list, it's a sublist of all the items found via grep.

<BR>

<P>Please check the man pages for using grep(). Some of the main types of predefined patterns are shown in Table 29.5.

<BR>

<BR>

<P ALIGN=CENTER>

<CENTER>

<FONT COLOR="#000080"><B>Table 29.5. Main types of predefined patterns.</B></FONT></CENTER>

<BR>



<TABLE  BORDERCOLOR=#000040 BORDER=1 CELLSPACING=2 WIDTH="100%" CELLPADDING=2 >

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

<I>Code </I>

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

<I>Pattern</I></FONT>

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

.

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Any character</FONT>

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

\d

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Digits [0-9]</FONT>

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

\D

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Anything but digits</FONT>

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

\w

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

[a-zA-Z]</FONT>

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

\W

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Anything but \w</FONT>

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

\s

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Space or tab</FONT>

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

\S

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Anything but \s</FONT>

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

\n

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Newline</FONT>

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

\r

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Carriage return</FONT>

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

\t

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Tab</FONT>

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

\f

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Formfeed</FONT>

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

\0

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Null</FONT>

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

\000

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Octal</FONT>

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

\X00

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Hex</FONT>

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

\cX

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

ASCII Control Character</FONT>

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

*

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Zero or more of previous pattern</FONT>

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

+

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

One or more of previous pattern</FONT>

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

?

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Zero or one of previous pattern</FONT>

</TABLE><P>Perl uses the special variable called $_. This is the default variable to use by Perl if you do not explicitly specify a variable name and Perl expects a variable. For example, in the grep() function, if you omit the LIST, grep() will use the 
string in the variable $_. The $_ variable is Perl's default string to search, assign input, or read for data for a number.

<BR>

<BR>

<A NAME="E68E235"></A>

<H3 ALIGN=CENTER>

<CENTER>

<FONT SIZE=5 COLOR="#FF0000"><B>Subroutines</B></FONT></CENTER></H3>

<BR>

<P>Perl 5 supports subroutines and functions with the sub command. You can use pointers to subroutines, too. The syntax for subroutines is

<BR>

<PRE>

<FONT COLOR="#000080">sub Name {

}</FONT></PRE>

<P>The ending curly brace does not require a semicolon to terminate it. If you are using a reference to a subroutine it can be declared without a Name, as shown here:

<BR>

<PRE>

<FONT COLOR="#000080">$ptr = sub {

};</FONT></PRE>

<P>Note the use of the <!--(semicolons):Perl subroutines;):Perl subroutines;-->semicolon to terminate the end of the subroutine. To call this function you would use the following line:

<BR>

<BR>

<PRE>

<FONT COLOR="#000080">&amp;\$ptr(argument list);</FONT></PRE>

<P>Parameters to subroutines are passed in the @_ array. To get the individual items in the array, we can use $_[0], $_[1], and so on. You can define your own local variables with the 'local' keyword.

<BR>

<PRE>

<FONT COLOR="#000080">sub sample {

local ($a, $b, @c, $x) = @_

&amp;lowerFunc();

}</FONT></PRE>

<P>In the preceding subroutine, you will find that $a = $_[0], $b = $_[1] and @c will point to the rest of the arguments as one list with $x empty. Generally, an array is the last assignment in such an assignment since it chews up all your parameters.

<BR>

<P>The 'local' variables will all be available for use in the lowerFunc() function. To hide the $a, $b, @c, and $x from lowerFunc, use the 'my' keyword like this:

<BR>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品白丝jk白祙喷水网站| 久久先锋影音av| 日韩精品中文字幕在线不卡尤物| 久久精品亚洲国产奇米99| 尤物在线观看一区| 国产大陆a不卡| 制服丝袜激情欧洲亚洲| 亚洲人成亚洲人成在线观看图片 | 91黄视频在线| 久久综合国产精品| 免播放器亚洲一区| 91久久精品一区二区三| 国产欧美日韩另类一区| 蜜臀久久99精品久久久久久9| 一本一道波多野结衣一区二区| 国产日韩欧美a| 精品一区二区三区在线观看 | 岛国精品在线播放| 久久色中文字幕| 日韩av一区二区三区四区| 欧洲一区二区三区免费视频| 国产精品剧情在线亚洲| 成人性色生活片| 国产人妖乱国产精品人妖| 国产一区欧美一区| 精品久久一区二区| 日本va欧美va瓶| 91精品国产乱码久久蜜臀| 亚洲午夜免费视频| 欧美日韩电影在线播放| 亚洲国产日韩av| 在线视频一区二区三区| 一区二区欧美在线观看| 欧美综合欧美视频| 婷婷开心激情综合| 欧美精品免费视频| 日本人妖一区二区| 精品欧美乱码久久久久久1区2区| 青青草成人在线观看| 精品日韩在线观看| 国产成人精品综合在线观看| 国产亚洲精品福利| av电影在线观看一区| 亚洲色大成网站www久久九九| 91在线高清观看| 亚洲国产综合人成综合网站| 欧美日韩久久不卡| 激情欧美一区二区| 中文字幕+乱码+中文字幕一区| 成人的网站免费观看| 亚洲免费观看高清在线观看| 欧美网站大全在线观看| 欧美bbbbb| 久久免费电影网| 99re这里只有精品首页| 性欧美疯狂xxxxbbbb| 精品国产伦一区二区三区观看体验 | 91在线高清观看| 亚洲成人免费看| 精品免费国产一区二区三区四区| 国产精品一区免费视频| 亚洲欧洲精品一区二区三区不卡| 91成人在线免费观看| 蜜臀精品久久久久久蜜臀| 国产精品欧美一区喷水| 91激情五月电影| 国产在线一区二区| 一区二区三区视频在线观看| 日韩欧美在线不卡| 99re成人精品视频| 久久99久久久久| 亚洲激情综合网| 精品国产欧美一区二区| 91黄色免费版| 国产成人午夜片在线观看高清观看| 亚洲三级电影全部在线观看高清| 日韩一区二区三区av| 色综合色综合色综合色综合色综合 | 中文字幕高清不卡| 欧美二区在线观看| 本田岬高潮一区二区三区| 视频一区二区国产| 亚洲视频你懂的| 久久蜜桃香蕉精品一区二区三区| 欧美日韩国产综合视频在线观看| 丰满放荡岳乱妇91ww| 蜜臀av性久久久久av蜜臀妖精| 亚洲欧美日韩在线| 中文字幕欧美国产| 精品粉嫩aⅴ一区二区三区四区| 一本色道久久综合亚洲91| 国产成人夜色高潮福利影视| 午夜视黄欧洲亚洲| 亚洲伦理在线精品| 欧美韩国日本一区| 久久久亚洲欧洲日产国码αv| 91麻豆精品国产| 色婷婷久久一区二区三区麻豆| 国产精品中文欧美| 另类专区欧美蜜桃臀第一页| 五月婷婷色综合| 亚洲综合丝袜美腿| 亚洲激情自拍偷拍| 亚洲猫色日本管| 中文字幕亚洲区| 欧美精彩视频一区二区三区| 精品久久久久久无| 欧美一级在线观看| 777久久久精品| 欧美体内she精高潮| 色婷婷狠狠综合| 在线一区二区三区四区五区 | 国产精品的网站| 中文字幕第一区二区| 久久久久久久国产精品影院| 久久久久久久性| 欧美国产一区视频在线观看| 久久精品免视看| 日本一区二区视频在线观看| 国产精品沙发午睡系列990531| 久久日韩粉嫩一区二区三区| 久久精品视频免费观看| 欧美国产欧美亚州国产日韩mv天天看完整 | 欧洲一区在线观看| 欧美三级资源在线| 欧美日韩色综合| 777奇米四色成人影色区| 欧美一级理论片| 精品国一区二区三区| 欧美激情中文不卡| 亚洲女同女同女同女同女同69| 一区二区在线观看av| 爽好久久久欧美精品| 捆绑调教一区二区三区| 国产精品一区二区无线| 91啪亚洲精品| 欧美久久久久久久久中文字幕| 日韩欧美123| 国产精品理论在线观看| 亚洲综合在线第一页| 麻豆成人久久精品二区三区红 | 一区二区三区四区视频精品免费| 午夜精品影院在线观看| 久久97超碰色| av不卡在线播放| 欧美老肥妇做.爰bbww视频| 久久综合色天天久久综合图片| 中文天堂在线一区| 婷婷综合在线观看| 国产一区二区不卡| 91极品视觉盛宴| 精品国产免费一区二区三区四区 | 不卡视频在线看| 91精品国产一区二区| 国产精品久线在线观看| 蜜臀av亚洲一区中文字幕| 99久久99久久综合| 精品欧美久久久| 亚洲一卡二卡三卡四卡无卡久久| 韩国欧美国产1区| 在线亚洲高清视频| 国产亚洲欧美在线| 亚洲成av人片在www色猫咪| 国产白丝网站精品污在线入口| 欧美日高清视频| 亚洲视频1区2区| 国产在线精品视频| 91国内精品野花午夜精品| 久久精品无码一区二区三区| 天天综合色天天综合| 99久久伊人久久99| 精品国产3级a| 首页综合国产亚洲丝袜| 91一区二区在线| 国产喷白浆一区二区三区| 麻豆免费精品视频| 欧美日韩国产首页| 亚洲乱码日产精品bd| 成人va在线观看| 久久久久久久网| 看电视剧不卡顿的网站| 欧美日韩国产另类一区| 亚洲色图另类专区| 99视频国产精品| 国产女人18毛片水真多成人如厕| 麻豆专区一区二区三区四区五区| 色噜噜久久综合| 亚洲视频免费观看| 91丨porny丨国产| 国产精品成人免费| 成人开心网精品视频| 久久久一区二区三区捆绑**| 极品少妇一区二区三区精品视频| 欧美日韩免费电影| 亚洲一卡二卡三卡四卡| 欧美在线|欧美| 亚洲第四色夜色| 欧美日本国产视频| 日本成人在线电影网| 日韩欧美激情一区|