??xml version="1.0" encoding="utf-8" standalone="yes"?>久久久久久久久四区三区,久久er99热精品一区二区三区,国产一区二区三区高清播放http://www.aygfsteel.com/yuoveyu/archive/2010/06/21/324046.html余坚余坚Mon, 21 Jun 2010 02:28:00 GMThttp://www.aygfsteel.com/yuoveyu/archive/2010/06/21/324046.htmlhttp://www.aygfsteel.com/yuoveyu/comments/324046.htmlhttp://www.aygfsteel.com/yuoveyu/archive/2010/06/21/324046.html#Feedback0http://www.aygfsteel.com/yuoveyu/comments/commentRss/324046.htmlhttp://www.aygfsteel.com/yuoveyu/services/trackbacks/324046.html 2010-3-29
【tomcat启动cBootstrap?
t1.tomcat的h口函敎ͼ启动c?
org.apache.catalina.startup. Bootstrap.java   Main函数

t2.Bootstrapc?
初始?ClassLoader, 然后利用 Java Reflection 调用 Catalina cL启动 tomcat server

【tomcat扩展-日志?
a1.private static Log log = LogFactory.getLog(Bootstrap.class);
日志可以定义为private 和static

a2.只在本类中用的Ҏ(gu),使用private,降低讉K权限,需要的时?再考虑重构或者提高访问权限public

a.日志打印前加if(log.isInfoEnabled())
如果代码中含有logger.debug(“string”);此类语句Q尽在log4j.xml配置文g中对该类logger的level? ERRORQ但是仍然会产生较大的内存开销Q通常是所要输出的string的几十倍甚至上癑ր大,对内存开销非常大。优化方法ؓQ用loggerq行 判断?


2010-3-30
【tomcat扩展-classloader?
a3.如果两个cd于同一个包下,但是׃同的classloader加蝲Q那么他们也不能互访defaultcdҎ(gu),属?

a4.classloader:与C或C++~写的程序不同,JavaE序q不是一个可执行文gQ而是p多独立的cL件组成,每一个文件基本上 对应于一个类。此外,q些cL件ƈ非立卛_部都装入内存Q而是Ҏ(gu)E序需要装入内存。ClassLoader是JVM中将c装入内存的那部?

a5.定制的ClassLoader应用:
1.在执行非|信代码之前Q自动验证数字签?
2.使用用户提供的密码透明地解密代?
3.动态地创徏W合用户特定需要的定制化构建类
4.M(zhn)认为可以生成Java字节码的内容都可以集成到应用E序?

a6.findClassҎ(gu)是创建定制的ClassLoader时唯一需要覆盖的Ҏ(gu)?
ClassLoader loadClassҎ(gu)
Class c = findLoadedClass(name);
if (c == null) {
    try {
if (parent != null) {
    c = parent.loadClass(name, false);
} else {
    c = findBootstrapClass0(name);
}
    } catch (ClassNotFoundException e) {
        // If still not found, then invoke findClass in order
        // to find the class.
        c = findClass(name);
    }
}

a7.ClassLoader(CCL)的Q务是保代码被编译和更新?
下面描述了它的工作方式:1、当h一个类Ӟ先查看它是否在磁盘的当前目录或相应的子目录?
2、如果该cM存在Q但源码中有Q那么调用Java~译器来生成cL件?
3、如果该cd存在Q检查它是否比源码旧。如果是Q调用Java~译器来重新生成cL件?
4、如果编译失败,或者由于其它原因不能从现有的源码中生成cLӞq回ClassNotFoundException?
5、如果仍然没有该c,也许它在其它库中Q所以调用findSystemClass来寻找该cR?
6、如果还是没有,则返回ClassNotFoundException?
7、否则,q回该类?
8、调用findLoadedClass来查看是否存在已装入的类?
9、如果没有,那么采用那种Ҏ(gu)的神奇方式来获取原始字节?
10、如果已有原始字节,调用defineClass它们{换成Class对象?
11、如果没有原始字节,然后调用findSystemClass查看是否从本地文件系l获取类?
12、如果resolve参数是trueQ那么调用resolveClass解析Class对象?
13、如果还没有c,q回ClassNotFoundException?
14、否则,类q回l调用程序?

【tomcat启动cclassloader?
t3.tomcat自定义了三个c,catalinaLoader commonLoaderQsharedLoader
Common - 载入$CATALINA_HOME/common/...它们对TOMCAT和所有的WEB APP都可?
Catalina - 载入$CATALINA_HOME/server/..它们仅对TOMCAT可见Q对所有的WEB APP都不可见
Shared-载入$CATALINA_HOME/shared/它们仅对所有WEB APP可见,对TOMCAT不可见(也不必见Q?

t4.Bootstrap通过反射初始化Catalinac,
反射调用CatalinaҎ(gu)setParentClassLoaderQ传递SharedClassloader
反射call CatalinaҎ(gu)load 利用server.xml中的配置初始化Service,Server,Engine,Host
反射call CatalinaҎ(gu)start Start the new server  该server是通过  解析xml文g生成的org.apache.catalina.core.StandardServerc?


【tomcat-xml解析?
1.Tomcat取了Digester中的interface和几个Rule,q且自己实现了一?Rule 来解析xml.
2.tomcat解析xml创徏以下几个c?
Server:
org.apache.catalina.core.StandardServer
Resources:
org.apache.catalina.deploy.NamingResources
Server's Listener:Q?监听server事gQ?
org.apache.catalina.core.AprLifecycleListener
org.apache.catalina.core.JasperListener
org.apache.catalina.mbeans.ServerLifecycleListener
org.apache.catalina.mbeans.GlobalResourcesLifecycleListener
Service:
org.apache.catalina.core.StandardService
Executor:
org.apache.catalina.core.StandardThreadExecutor
Engine:
org.apache.catalina.core.StandardEngine
Connector:
org.apache.catalina.connector.Connector

【tomcat-程?
3.StandardServer启动StandardServiceQStandardService启动ConnectorQ?
Connector启动Http11ProtocolQHttp11Protocol启动JIoEndpointQ?
JioEndpoint启动server SocketQlistern 8080端口,处理httph

4.Http11Processor
Processes HTTP requests.
由http11ConnectionHandler调用QHttp11ConnectionHandler由JioEndpoint中的Work 调用

5.A connector passes the request and reponse objects to the Container by calling the Container interface's invoke method
public void invoke(Request request, Response response)
        throws IOException, ServletException;

inside the invoke method ,the container loads the servlet class,call its sevice method ,manage sessions,etc.

6.Connector Ҏ(gu)initialize?
// Initializa adapter
adapter = new CoyoteAdapter(this);
protocolHandler.setAdapter(adapter);
adapter通过protocolHandler(Http11Protocol)传给Http11Processor,
Http11Processor解析Qcreate request和response,通过adapter传送给Container

7.Tomcat使用Pipeline模式在各层容器间传递请求,请求通过道依次通过EngineQHostQContext? Wrapper。另外,每一个容?nbsp; 
都可以设|一pd的Valvedhq行?截,像道中的阀一样对h的行行一些干涉?


2010-3-31
【tomcat-程?
1.tomcat的pipeline/valve是标准的责Q链模?每个U别的容器中pipeline所有的valve都完成动作后会将 request/response传到下一个容器的pipeline中的valve,
q样一直传递下ȝ到Wrapper的BaseValve.
Ps:每个容器的BaseValve会调用下个容器的起始valve

2.StandardEngine
属性Pipeline  pipeline = new StandardPipeline(this);
构造函数里会设|最底层的阀?
pipeline.setBasic(new StandardEngineValve());
如果需要设|新阀门处理需求,只需要调?pipeline.addValve(Valve valve);

3.CoyoteAdapter中会执行
connector.getContainer().getPipeline().getFirst().invoke(request, response);
该行代码会一层一层调用添加的阀?处理下去.

2010-4-1
【tomcat-程?
1.jk插g负责tomcat和其它http容器q行通信

2.q接器协议AJP/1.3是tomcat用来与其它http容器q行q接的协?

3.把指定Context的classloader付给当前U程?
Thread.currentThread().setContextClassLoader(context.getLoader().getClassLoader()); q样request只看见指定的context下面的classes和jar?而看不见tomcat本n的类?

2010-4-7
【tomcat-socke与workerU程?
/**
* Process an incoming TCP/IP connection on the specified socket.  Any
* exception that occurs during processing must be logged and swallowed.
* <b>NOTE</b>:  This method is called from our Connector's thread.  We
* must assign it to our own thread so that multiple simultaneous
* requests can be handled.
* @param socket TCP socket to process
*/
synchronized void assign(Socket socket) {
// Wait for the Processor to get the previous Socket
while (available) {
try {
              wait();
       } catch (InterruptedException e) {
       }
    }
    // Store the newly available Socket and notify our thread
    this.socket = socket;
    available = true;
    notifyAll();
}

/**
* Await a newly assigned Socket from our Connector, or <code>null</code
* if we are supposed to shut down.
*/
private synchronized Socket await() {
// Wait for the Connector to provide a new Socket
while (!available) {
try {
wait();
} catch (InterruptedException e) {
}
}
    // Notify the Connector that we have received this Socket
    Socket socket = this.socket;
    available = false;
    notifyAll();
return (socket);
}
q接器线E调用workercȝassignc,workercȝ执行U程runҎ(gu)会调用awaitҎ(gu)获取socketQ通过 available变量的设|和wait/notifyҎ(gu)来协调彼此的操作。当q接器线E未传输socketQworkercȝE就执行wait{待Q?
当workercL行线E在处理忙的时候,q接器线Ewait?


余坚 2010-06-21 10:28 发表评论
]]>
[版本控制]svn命o行笔?/title><link>http://www.aygfsteel.com/yuoveyu/archive/2010/06/21/324034.html</link><dc:creator>余坚</dc:creator><author>余坚</author><pubDate>Mon, 21 Jun 2010 02:02:00 GMT</pubDate><guid>http://www.aygfsteel.com/yuoveyu/archive/2010/06/21/324034.html</guid><wfw:comment>http://www.aygfsteel.com/yuoveyu/comments/324034.html</wfw:comment><comments>http://www.aygfsteel.com/yuoveyu/archive/2010/06/21/324034.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/yuoveyu/comments/commentRss/324034.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/yuoveyu/services/trackbacks/324034.html</trackback:ping><description><![CDATA[svn命o行操? <br /> <br /> 1.svn update 更新 (写up) <br /> svn update -r 500 test.java(版本库中的文gtest.javaq原到版?00) <br /> <br /> 2.svn commit -m"u" (写ci) <br /> 提交变更的文? <br /> <br /> 3.查看文g信息svn info path <br /> 查看文g内容svn cat path <br /> <br /> 4.svn status path <br /> 会目录下的文件和子目录的状态,正常状态的则不昄Q很正常Q不然在目根目录执行,会|列Z大堆文g? <br /> 昄的状态信息中?Q表CZ在svn的控制中 MQ表C本地文件被修改q? CQ表C本地文件与服务器文件发生冲H(如果不带-u选项,x冲突也不会显C) AQ表C预定要加入到版本库 KQ表C锁定 <br /> '!'  表示丢失Q一般是受控文件直接删除导? <br /> svn st -u path   -u选项表示不仅仅本圎ͼ服务器上的变更也会昄 <br /> <br /> 5.删除文g <br /> svn delete test.java 然后再svn ci -m 'delete‘Q将在本地和服务器上都删除该文g <br /> <br /> 6. d新文? <br /> svn add test.java(dtest.java)  然后再svn ci -m"add",再服务器上d该文? <br /> 如果不执行commit操作Q服务器上将不会d <br /> <br /> 7.svn: Commit failed (details follow): <br /> svn: Directory '/home/yuyu/f/workspace/ouyu/WebRoot/WEB-INF/classes' is missing <br /> 解决Ҏ(gu)Qsvn update /home/yuyu/f/workspace/ouyu/WebRoot/WEB-INF/classes <br /> <br /> 8. 服务器覆盖本地文? <br /> 执行svn revert test.java命o撤销自己的修?再执行update, <br /> 则服务器的文件会覆盖自己修改的文件? <br /> <br /> 9.svn list path(or url) <br /> 昄目标下的文g和目录列表? <br /> <br /> 10.svn diff <br /> svn diff path                 查看文g的不同处(本地版本的变更比? <br /> svn diff -r n1:n2 path   n1和n2版本的同一文g比较 <br /> <br /> 11. 发生冲突 <br /> 执行svn update后会紧跟选择性操作,一U直接选择解决Q修Ҏ(gu)? <br /> 一U选择推迟解决Q则之后需要执行svn resolved test.java,才能最lcommit <br /> <img src ="http://www.aygfsteel.com/yuoveyu/aggbug/324034.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/yuoveyu/" target="_blank">余坚</a> 2010-06-21 10:02 <a href="http://www.aygfsteel.com/yuoveyu/archive/2010/06/21/324034.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>javaio-WriteStringToFilehttp://www.aygfsteel.com/yuoveyu/archive/2010/05/10/320474.html余坚余坚Mon, 10 May 2010 05:57:00 GMThttp://www.aygfsteel.com/yuoveyu/archive/2010/05/10/320474.htmlhttp://www.aygfsteel.com/yuoveyu/comments/320474.htmlhttp://www.aygfsteel.com/yuoveyu/archive/2010/05/10/320474.html#Feedback0http://www.aygfsteel.com/yuoveyu/comments/commentRss/320474.htmlhttp://www.aygfsteel.com/yuoveyu/services/trackbacks/320474.htmlpackage cn.yu.test.io;
import java.io.DataOutputStream;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.OutputStreamWriter;
import java.io.PrintStream;
import java.io.PrintWriter;
import java.io.RandomAccessFile;
/**
 * WriteStringToFile
 * 
@version 1.0
 * @date 2010/5/10
 *
*/
public class WriteStringToFile {
    
public static void main(String[] args) {
        
try {
            String aString 
= "Hello你好";
        
            FileWriter fw 
= new FileWriter("c:/out.fw.txt");
            fw.write(aString);
            fw.close();   
//默认gbk~码9字节
            ////////////////////////////////////////////////////////////////////////////
            OutputStreamWriter osw = new OutputStreamWriter(new FileOutputStream("c:/out.osw.txt"),"UTF-8");
            osw.write(aString);
            osw.close();  
//utf-8~码 11字节
            
            
///////////////////////////////////////////////////////////
            DataOutputStream dos = new DataOutputStream(new FileOutputStream("c:/out.dos.txt"));
            dos.writeChars(aString);
            dos.close();  
//14个字? 每个字符用该字符2字节的unicode表示
            //////////////////////////////////////////////////////////////
            PrintStream ps = new PrintStream(new FileOutputStream("c:/out.ps.txt"));
            ps.print(aString);
            ps.close(); 
//默认gbk~码9字节
            //////////////////////////////////////////////
            PrintWriter pw = new PrintWriter(new FileOutputStream("c:/out.pw.txt"));
            pw.print(aString);
            pw.close(); 
//默认gbk~码9字节  
             ///////////////////////////////////////////////
            RandomAccessFile ra = new RandomAccessFile("c:/out.fa.txt""rw");
            ra.writeUTF(aString); 
//
            ra.close(); //13个字?nbsp;,前两个直接表CZ个无W号整数,值是q个字符串的字符所需要的字节?/span>
            ////////////////////////////////////////////////
            RandomAccessFile ra2 = new RandomAccessFile("c:/out.fa2.txt""rw");
            ra2.writeChars(aString);
            ra2.close(); 
//14个字? 每个字符用该字符2字节的unicode表示
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}


余坚 2010-05-10 13:57 发表评论
]]>
perlC?/title><link>http://www.aygfsteel.com/yuoveyu/archive/2010/05/06/320202.html</link><dc:creator>余坚</dc:creator><author>余坚</author><pubDate>Thu, 06 May 2010 06:29:00 GMT</pubDate><guid>http://www.aygfsteel.com/yuoveyu/archive/2010/05/06/320202.html</guid><wfw:comment>http://www.aygfsteel.com/yuoveyu/comments/320202.html</wfw:comment><comments>http://www.aygfsteel.com/yuoveyu/archive/2010/05/06/320202.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/yuoveyu/comments/commentRss/320202.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/yuoveyu/services/trackbacks/320202.html</trackback:ping><description><![CDATA[<div style="margin: 6px; padding: 0px; font-family: Verdana; font-size: 10pt; color: rgb(0, 0, 0); min-height: 1100px; counter-reset: __goog_page__ 0; line-height: normal; background-color: rgb(255, 255, 255);"> <div style="margin-top: 0px; margin-bottom: 0px;">perlC?br /> <br /> 1. 'yu' x 3    #  print yuyuyu<br /> <br /> 2.print "yu jian ${age}s" # 加{}  促变量不会变成$ages<br /> <br /> 3. 4 ** 2  #4的^?br /> <br /> 4.(1..5) #  -->(1,2,3,4,5)<br /> <br /> <div style="margin-top: 0px; margin-bottom: 0px;">5.qw ( yu jian's book)  # z,更少输入</div> <br /> <div style="margin-top: 0px; margin-bottom: 0px;">6.($yu,$jian)=($jian,$yu) # g?/div> <br /> <div style="margin-top: 0px; margin-bottom: 0px;">7.($yu,$jian)=qw(yu jian) # 赋?/div> <br /> <div style="margin-top: 0px; margin-bottom: 0px;">8.@array=qw/yu jian/; #数组 </div> <br /> <div style="margin-top: 0px; margin-bottom: 0px;">9.@array=5..9;</div> <div style="margin-top: 0px; margin-bottom: 0px;">$yu=pop(@array)  # $yu=9  and @array=(5,6,7,8)</div> $yu=pop @array  # $yu=8  and @array=(5,6,7)<br /> <br /> <div style="margin-top: 0px; margin-bottom: 0px;">10.如果数组为空 pop不会报错Q什么也不返回,直接q回undef<br /> <br /> </div> 11.push(@array,0)  # @array=(5,6,7,0)<br /> <br /> <div style="margin-top: 0px; margin-bottom: 0px;">12.pop和push都操作数l末?/div> <br /> </div> <div style="margin-top: 0px; margin-bottom: 0px;">13.shift和unshift是对数组的开始端操作</div> <br /> <div style="margin-top: 0px; margin-bottom: 0px;">14.$_  perl的默认变?/div> <div style="margin-top: 0px; margin-bottom: 0px;">for(1...10){</div> <div style="margin-top: 0px; margin-bottom: 0px;">    print $_;  # $_ = 1 or 2 or 3...</div> <div style="margin-top: 0px; margin-bottom: 0px;">}</div> <br /> <div style="margin-top: 0px; margin-bottom: 0px;">15.perl会正处理上下文</div> <div style="margin-top: 0px; margin-bottom: 0px;">@people=qw{yu gao};</div> <div style="margin-top: 0px; margin-bottom: 0px;">@list=@people #得到列表</div> <div style="margin-top: 0px; margin-bottom: 0px;">$n=@people #得到人数2</div> <br /> <div style="margin-top: 0px; margin-bottom: 0px;">16.scalar @array #scalar D切换为标量上下文</div> <div style="margin-top: 0px; margin-bottom: 0px;">@array =qw/yu jian gao su/;</div> <div style="margin-top: 0px; margin-bottom: 0px;">print "love is ".@array."\n"; #love is 4</div> <div style="margin-top: 0px; margin-bottom: 0px;">print "love is ",@array,"\n"; #love is yujiangaosu</div> <div style="margin-top: 0px; margin-bottom: 0px;">print "love is ".scalar @array,"\n";#love is 4</div> <br /> <div style="margin-top: 0px; margin-bottom: 0px;">17.@lines=<STDIN> #在列表上下文中读取标准输?/div> <br /> <br /> 18.chomp L所有的换行W?chmop(@lines)<br /> <br /> <div style="margin-top: 0px; margin-bottom: 0px;">19.调用自定义方? &methodName;</div> <br /> <div style="margin-top: 0px; margin-bottom: 0px;">20.sub max{</div> <div style="margin-top: 0px; margin-bottom: 0px;">    if(@_!=2){  #判断参数个数</div> <div style="margin-top: 0px; margin-bottom: 0px;">        print "waning!!!"Q?br /> </div> <div style="margin-top: 0px; margin-bottom: 0px;">        return -1;<br /> </div> <div style="margin-top: 0px; margin-bottom: 0px;">    }<br /> </div> <div style="margin-top: 0px; margin-bottom: 0px;">    my($m,$n); #创徏新的所有变?br /> </div> <div style="margin-top: 0px; margin-bottom: 0px;">    ($m,$n)=@_; #参数赋值给变量<br /> </div> <div style="margin-top: 0px; margin-bottom: 0px;">    if($m > $n){$m}else{$n}</div> <div style="margin-top: 0px; margin-bottom: 0px;">}<br /> <br /> </div> <div style="margin-top: 0px; margin-bottom: 0px;">21.my($num)=@_ #获取数组的第一个元?/div> <div style="margin-top: 0px; margin-bottom: 0px;">    my $num=@_ #数组的数?/div> <br /> <div style="margin-top: 0px; margin-bottom: 0px;">22.use strice ; #强制使用一些严格的良好的程序语a规则<br /> <br /> 23.sub division{</div> <div style="margin-top: 0px; margin-bottom: 0px;">        $_[0] / $_[1]; #W一个参数和W二个参?br /> </div> <div style="margin-top: 0px; margin-bottom: 0px;">}<br /> <br /> </div> <div style="margin-top: 0px; margin-bottom: 0px;">24.@ARGV=qw# file1 file2 #;# 强制让砖x作符dq两个文?/div> <div style="margin-top: 0px; margin-bottom: 0px;">while(<>){</div> <div style="margin-top: 0px; margin-bottom: 0px;">    chomp;<br /> </div> <div style="margin-top: 0px; margin-bottom: 0px;">    print "It was $_\n":<br /> </div> <div style="margin-top: 0px; margin-bottom: 0px;">}<br /> <br /> </div> <div style="margin-top: 0px; margin-bottom: 0px;">25.printf "Hello, %s; your password in %d days!\n",$user,$days;#格式化输?/div> <div style="margin-top: 0px; margin-bottom: 0px;">%d 整数 %g 点?/div> <br /> <div style="margin-top: 0px; margin-bottom: 0px;">27.die处理错误输出</div> <br /> <div style="margin-top: 0px; margin-bottom: 0px;">28.d文g</div> <div style="margin-top: 0px; margin-bottom: 0px;">open CONFIG,"c:/test.txt";</div> <div style="margin-top: 0px; margin-bottom: 0px;">while(<CONFIG>){</div> <div style="margin-top: 0px; margin-bottom: 0px;">print $_."\n";</div> <div style="margin-top: 0px; margin-bottom: 0px;">}</div> <br /> 29. say == print  xxxx ."\n"  # say  相当 {于print 加换行符<br /> <br /> <div style="margin-top: 0px; margin-bottom: 0px;">30.hash</div> <div style="margin-top: 0px; margin-bottom: 0px;">$family_name{"fred"}="flint";</div> <div style="margin-top: 0px; margin-bottom: 0px;">$family_name{"bar"} ="rubble";</div> <br /> %family_name("fred","flint","bar","rubble");<br /> <br /> <div style="margin-top: 0px; margin-bottom: 0px;">my %family_name=(</div> <div style="margin-top: 0px; margin-bottom: 0px;">    "fred" => "flint",<br /> </div> <div style="margin-top: 0px; margin-bottom: 0px;">    "bar" => "rubblle";<br /> </div> <div style="margin-top: 0px; margin-bottom: 0px;">)</div> <br /> my @k=keys %family_name; <div style="margin-top: 0px; margin-bottom: 0px;">my @v=values %family_name;  #return array</div> <br /> <div style="margin-top: 0px; margin-bottom: 0px;">31.</div> <div style="margin-top: 0px; margin-bottom: 0px;">each函数</div> <div style="margin-top: 0px; margin-bottom: 0px;">while( ($key,$value)=each %family_name ){</div> <div style="margin-top: 0px; margin-bottom: 0px;">        print "$key => $value\n";<br /> </div> <div style="margin-top: 0px; margin-bottom: 0px;">}</div> <div style="margin-top: 0px; margin-bottom: 0px;">exists函数</div> <div style="margin-top: 0px; margin-bottom: 0px;">if(exists $family_name("dino")){</div> <br /> <div style="margin-top: 0px; margin-bottom: 0px;">}</div> <div style="margin-top: 0px; margin-bottom: 0px;">delete函数</div> delete $family{"fred"};<br /> <br /> <div style="margin-top: 0px; margin-bottom: 0px;">32.\1,\2使用反向引用</div> <div style="margin-top: 0px; margin-bottom: 0px;">$_=""abba;</div> <div style="margin-top: 0px; margin-bottom: 0px;">if(/(.)\1/){#匚w?bb</div> <div style="margin-top: 0px; margin-bottom: 0px;">    print "it matched";<br /> </div> <div style="margin-top: 0px; margin-bottom: 0px;">}</div> <br /> 33. \d = [0-9] <div style="margin-top: 0px; margin-bottom: 0px;">\w = [A-Za-z0-9_]</div> [^\d] 非数? <div style="margin-top: 0px; margin-bottom: 0px;">[^\w]非词</div> <div style="margin-top: 0px; margin-bottom: 0px;">[^\s]非空白字W?/div> <br /> <div style="margin-top: 0px; margin-bottom: 0px;">34./yes/i  # /i 不区分大写</div> <br /> <div style="margin-top: 0px; margin-bottom: 0px;">35./s 匚wL字符 Q?不包括换?/div> <br /> <div style="margin-top: 0px; margin-bottom: 0px;">36./xq行加入I白Q便于阅ȝ?/div> <br /> <div style="margin-top: 0px; margin-bottom: 0px;">37.m//模式匚w搜烦功能</div> <div style="margin-top: 0px; margin-bottom: 0px;">S/// 模式匚w替换功能</div> <div style="margin-top: 0px; margin-bottom: 0px;">/g 全局替换</div> <br /> <div style="margin-top: 0px; margin-bottom: 0px;">38.@fields = split /separator/ , $string;</div> <br /> <div style="margin-top: 0px; margin-bottom: 0px;">39.my $result = join $glue,@pieces;</div> <div style="margin-top: 0px; margin-bottom: 0px;">my $x = join ":",4,5,6; # $x = "4:5:6";</div> <br /> <div style="margin-top: 0px; margin-bottom: 0px;">40.*贪婪 *Q非贪婪版本</div> <br /> 41.从命令行q行在线~辑 <div style="margin-top: 0px; margin-bottom: 0px;">perl -p -w -e "s/ran/ra/g" fred.dat</div> <div style="margin-top: 0px; margin-bottom: 0px;">-p 打印  -n L自动打印  -w 打开警告选项  -e 表示后面更得是代码,而不是普通的参数</div> <br /> <div style="margin-top: 0px; margin-bottom: 0px;">42.last cMbreak </div> <br /> <div style="margin-top: 0px; margin-bottom: 0px;">43.my $stuff="Howdy world!";</div> <div style="margin-top: 0px; margin-bottom: 0px;">my $where=index($stuff,"wor"); # $where =  6<br /> <br /> </div> <div style="margin-top: 0px; margin-bottom: 0px;">44.my $mineral=substr("Fred J. Flintstone",8,5); # gؓFlint</div> <br /> <div style="margin-top: 0px; margin-bottom: 0px;">45.匚w对应不同h作数Q不同d处理方式<br /> %a ~~ %b         哈希的键是否一?br /> %a ~~@b          臛_%a中的一个键在列表@b之中<br /> %a ~~ /Fred/     臛_一个键匚wl定的模?br /> %a ~~ 'Fred'      哈希中某一指定?a{'Fred'} 是否存在<br /> @a ~~ /Fred/     有一个元素匹配给定的模式<br /> @a ~~ 123        臛_有一个元素{化ؓ数字后事123<br /> <br /> $name ~~ undef  $name实未定义<br /> <br /> 46.system 启动子进E?br /> system "date";<br /> <br /> 14.my $tarfile="some*.tar";<br /> my @dirs=qw(fred|flinet<bar&rubble> betty);<br /> system "tar"."cvf",$tarfile,@dirs;  带参数的pȝ命o调用<br /> <br /> 47.system的所有语法对exec都适用<br /> 执行execcMgoto语句Q蟩转到另个q程q行执行Q当前perlq程会关?br /> chdir "/tmp" or die "cannot chdir /tmp: #!";<br /> ecec "bedrock","-o","args1",@ARGV;<br /> <br /> 48.$ENV{'PATH'}="/home/rootbeer/bin:$ENV{'PATH'}";<br /> delete $ENV{'IFS'};<br /> my $make_result= system "make";<br /> 改修改ƈ不能影响shell或者其他父q程<br /> <br /> 49.my $now =`date`;<br /> print "The time is now $now";<br /> 力反引可用进E?br /> <br /> 50.perl -p -i.old -e "s/try//g" test.txt 替换文g中的内容,重新写入文gQ?原文件备份ؓold后缀的文?<br /> windows下要用双引号<br /> <br /> 51.<br /> <br /> </div> </div> <img src ="http://www.aygfsteel.com/yuoveyu/aggbug/320202.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/yuoveyu/" target="_blank">余坚</a> 2010-05-06 14:29 <a href="http://www.aygfsteel.com/yuoveyu/archive/2010/05/06/320202.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss> <footer> <div class="friendship-link"> <a href="http://www.aygfsteel.com/" title="狠狠久久亚洲欧美专区_中文字幕亚洲综合久久202_国产精品亚洲第五区在线_日本免费网站视频">狠狠久久亚洲欧美专区_中文字幕亚洲综合久久202_国产精品亚洲第五区在线_日本免费网站视频</a> </div> </footer> վ֩ģ壺 <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ɽ</a>| <a href="http://" target="_blank">ַ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">Զ</a>| <a href="http://" target="_blank">ƺ</a>| <a href="http://" target="_blank">ʯ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ԭ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ˮ</a>| <a href="http://" target="_blank">ٹ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ƶ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ƺ</a>| <a href="http://" target="_blank">կ</a>| <a href="http://" target="_blank">ذ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ͨ</a>| <a href="http://" target="_blank">º</a>| <a href="http://" target="_blank">佭</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">пǰ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">齭</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ԭ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ˮ</a>| <a href="http://" target="_blank"></a>| <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body>