“Perl language entry” self-Notes - Chapter 1

  This can finally get the erupted.    It is precisely because the second edition of turn, the Internet did not hesitate to buy this book on the camel.    But the time has just received is not suspected of setting the wrong book, because the second edition of the very first chapter to write beautiful, a simple example gradually expanded to a 1,2 per cent last trip procedures.    The introduction of very-this is not to revisit chances.    The first chapter the author is talking about some perl the relevant knowledge.    Only in the last five to set out a small example.    Although feeling suddenly dropped, but the enthusiasm of the perl reduction, or a good look at the book from scratch need to learn, and do not want to write Jiaoben are Luanfan each book, although the results of tasks to be completed but always not remember.    Now the Congtoulaiguo determination.    Hope that this book can Kenwan! 
  Nonsense speak and start learning! 

  I am not from the beginning of the process, some of perl先讲people to be aware of knowledge.    Perl invention: Larry Wall.    This is a fervent people.    I have a set of Perl maillist, often to see Larry Wall in answering the question many fans, and concise language, humor.    Maillist believe that the people must also was deeply moved.    And he will always be guaranteed a free perl!    How can we not support him and lovely Perl?    Is also necessary to CPAN, the Perl community, "store."    Containing all of the Perl all: Perl source code itself, the various platforms binary version of the Perl, examples, documentation, Perl extension (almost all of the Perl module can be found above), as well as information on the Perl file.    Website: http://www.cpan.org/, of course, we also have the linux community his mirror site: http://cpan.linuxforum.net/.    There is one final point I would like to wordy, as Perl does not require c, c + +, java, as compiled needs can be implemented.    Perl just want to make him authority to run the executable of your program.    Well, to pave the way these, more than the simple ^ _ ^. 
  Chapter I have two procedures, the first one was the famous hello world.    I did not intend to write here, but to the integrity, so he also wrote out: 

  Example 1: 
  #! / Usr / local / bin / perl-w 
  Print "Hello, world! \ N"; 
  Very simple, the real procedure on his (second line).    Perl is the first line of each need written procedures.    As perl in your system where, or which can be used to find whereis.    Generally in / usr / bin / perl or / usr / local / bin / perl these two places.    And - w is my own habits.    This is a very good parameters, he pointed out that the procedure where you do not need the attention of the local norms.    I suggest you also add.    Only benefits do no harm ^ _ ^.    The second sentence I think we can see to understand.    (\ N is for firms to mean) 

  Example 2: 
  #! / Usr / local / bin / perl-w 
  @ Lines = `perldoc-u-f atan2`; 
  Foreach (@ lines) ( 
  S / \ w <([^>]+)>/ \ $ 1 U / g; 
  Print; 
  ) 
  This example is the flavor of the Perl.    Let you in a lot of dizziness symbols.    This example does not want to explain carefully, because it involves too much behind in the knowledge, and pasted up just to look at procedures for the implementation of the results: see you in the eye is not powerful enough ^ _ ^.    Another point to point out that the second line is not a single quotation marks, but anti-quotes, inside the shell can be ordered Add! 
  Laijiangjiang perldoc of the first order: it is specifically designed to read and display Perl in the documents, as well as practical tools related to expansion.    See perldoc-u-f atan2 order in the implementation of the results: 
  Bash-2.05 $ perldoc-u-f atan2 
  = Item atan2 Y, X 

  Returns the arctangent of Y / X in the range-PI to PI. 

  For the tangent operation, you may use the C 

  Function, or use the familiar relation: 

  (Sin sub tan ($ _ [0]) / cos ($ _ [0])) 

  Finally another look at the procedures for the implementation of the results: 
  Bash-2.05 $ ./ex1-3.plx 
  = Item atan2 Y, X 

  Returns the arctangent of Y / X in the range-PI to PI. 

  For the tangent operation, you may use the POSIX:: TAN () 
  Function, or use the familiar relation: 

  (Sin sub tan ($ _ [0]) / cos ($ _ [0])) 
  See the difference between ~ ~ ~, huh!    Combining procedures to first understand it. 
  First chapter of the exercises is to let you also feel these two examples, it is not playing out.    After the exercises, I will fight them. 

Bookmark it: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • Sphinn
  • del.icio.us
  • Google
  • DotNetKicks
  • DZone
  • Furl
  • Netvouz

Tags:

Releated Articles


0 Comments to ““Perl language entry” self-Notes - Chapter 1”

No Comments. Send your comment.

Leave a Reply

You must be logged in to post a comment.