Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Save to My Library
Look up keyword or section
Like this
2Activity

Table Of Contents

0 of .
Results for:
No results containing your search query
P. 1
Impatient Perl

Impatient Perl

Ratings: (0)|Views: 6 |Likes:
Published by Canh Nguyen

More info:

Published by: Canh Nguyen on Dec 14, 2010
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

11/09/2011

pdf

text

original

 
Impatient Perl
version: 9 September 2010Copyright 2004-2010 Greg London
Permission is granted to copy, distribute and/or modify this documentunder the terms of the GNU Free Documentation License, Version 1.3or any later version published by the Free Software Foundation;with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.A copy of the license is included in the section entitled "GNUFree Documentation License".
Cover Art (Front and Back) on the paperback version of Impatient Perl is excluded fromthis license. Cover Art is Copyright Greg London 2004, All Rights Reserved.For latest version of this work go to:http://www.greglondon.com1
 
Table of Contents
1 The Impatient Introduction to Perl..........................................................................................................71.1 The history of perl in 100 words or less..........................................................................................71.2 Basic Formatting for this Document...............................................................................................71.3 Do You Have Perl Installed.............................................................................................................81.4 Your First Perl Script, EVER..........................................................................................................91.5 Default Script Header......................................................................................................................91.6 Free Reference Material................................................................................................................101.7 Cheap Reference Material.............................................................................................................101.8 Acronyms and Terms....................................................................................................................102 Storage..................................................................................................................................................112.1 Scalars...........................................................................................................................................112.1.1 Scalar Strings.........................................................................................................................122.1.1.1 String Literals.................................................................................................................122.1.1.2 Single quotes versus Double quotes..............................................................................132.1.1.3 chomp.............................................................................................................................132.1.1.4 concatenation.................................................................................................................132.1.1.5 repetition........................................................................................................................132.1.1.6 length..............................................................................................................................132.1.1.7 substr..............................................................................................................................132.1.1.8 split.................................................................................................................................142.1.1.9 join.................................................................................................................................142.1.1.10 qw.................................................................................................................................152.1.1.11 Multi-Line Strings, HERE Documents........................................................................152.1.2 Scalar Numbers......................................................................................................................162.1.2.1 Numeric Literals............................................................................................................162.1.2.2 Numeric Functions.........................................................................................................162.1.2.3 abs..................................................................................................................................162.1.2.4 int...................................................................................................................................162.1.2.5 trigonometry (sin,cos)....................................................................................................172.1.2.6 exponentiation................................................................................................................172.1.2.7 sqrt..................................................................................................................................172.1.2.8 natural logarithms(exp,log)............................................................................................182.1.2.9 random numbers (rand, srand).......................................................................................182.1.3 Converting Between Strings and Numbers.......................................................................192.1.3.1 Stringify.........................................................................................................................192.1.3.1.1 sprintf.....................................................................................................................192.1.3.2 Numify...........................................................................................................................202.1.3.2.1 oct...........................................................................................................................212.1.3.2.2 hex..........................................................................................................................212.1.3.2.3 Base Conversion Overview....................................................................................212.1.4 Undefined and Uninitialized Scalars.....................................................................................222.1.5 Booleans................................................................................................................................232
 
2.1.5.1 FALSE...........................................................................................................................242.1.5.2 TRUE.............................................................................................................................242.1.5.3 Comparators...................................................................................................................252.1.5.4 Logical Operators...........................................................................................................262.1.5.4.1 Default Values........................................................................................................272.1.5.4.2 Flow Control..........................................................................................................272.1.5.4.3 Precedence..............................................................................................................272.1.5.4.4 Assignment Precedence..........................................................................................272.1.5.4.5 Flow Control Precedence.......................................................................................282.1.5.4.6 Conditional Operator..............................................................................................282.1.6 References..............................................................................................................................292.1.7 Filehandles.............................................................................................................................312.1.8 Scalar Review........................................................................................................................322.2 Arrays............................................................................................................................................322.2.1 scalar (@array)......................................................................................................................332.2.2 push(@array, LIST)...............................................................................................................342.2.3 pop(@array)...........................................................................................................................342.2.4 shift(@array)..........................................................................................................................352.2.5 unshift( @array, LIST)..........................................................................................................352.2.6 foreach (@array)....................................................................................................................362.2.7 sort(@array)...........................................................................................................................372.2.8 reverse(@array).....................................................................................................................382.2.9 splice(@array).......................................................................................................................392.2.10 Undefined and Uninitialized Arrays....................................................................................392.3 Hashes...........................................................................................................................................392.3.1 exists ( $hash{$key} )............................................................................................................412.3.2 delete ( $hash{key} ).............................................................................................................422.3.3 keys( %hash ).........................................................................................................................422.3.4 values( %hash )......................................................................................................................432.3.5 each( %hash ).........................................................................................................................432.4 List Context...................................................................................................................................472.5 References.....................................................................................................................................492.5.1 Named Referents...................................................................................................................502.5.2 References to Named Referents.............................................................................................502.5.3 Dereferencing........................................................................................................................502.5.4 Anonymous Referents...........................................................................................................512.5.5 Complex Data Structures.......................................................................................................532.5.5.1 Autovivification.............................................................................................................542.5.5.2 Multidimensional Arrays...............................................................................................552.5.5.3 Deep Cloning, Deep Copy.............................................................................................562.5.5.4 Data Persistence.............................................................................................................562.5.6 Stringification of References.................................................................................................562.5.7 The ref() function...................................................................................................................573 Control Flow.........................................................................................................................................583.1 Labels............................................................................................................................................603.2 last LABEL;..................................................................................................................................603.3 next LABEL;.................................................................................................................................603

You're Reading a Free Preview

Download
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->