Unformatted text preview:

Emily Goldberg Scalar holds one piece of data Numbers Floating Point Integer Non decimal 3 11023 12 0377 octal 2 7e32 3 814 524 705 0xff hex 0b11111111 binary Strings SingleQuoted hello nthere Double Quoted hello nthere hello nthere hello there string world print hi string n hi world Use prefix to denote a variable Ex points 5 name2 Larry Variable names can contain letters numbers and underscores but may NOT begin with a number Number Operators Operation Operator Add Subtract Multiply Divide Modulus Exponentiation Assign Comparison Example 10 5 3 2 1 2 3 8 String Operators Operation Operator Example Concatenation hello world helloworld Repetition x hello x3 hellohellohello Comparison eq ne lt gt le ge Assignment name2 Lee larry Lee Operations Results hello 3 5 hello15 12 3 36 12fred34 12 fred 3 36 12 Output Ex print The answer is 6 7 n Input Ex line STDIN Remove n chomp line if language eq Perl print Always use curly braces else print Who knows while defined line STDIN chomp line print This line was line n while chomp print This line was n A list is an ordered collection of scalars An array is a variable that contains a list A list with five elements numbers 1 2 3 4 numbers 1 4 numbers 0 one print numbers numbers a pop numbers push numbers a 3 Learning Perl by Randal Schwartz and Tom Phoenix Via Drexel Library electronic resources Perl Basics http www cs drexel edu knowak c s265 fall 2009 perl basics pdf


View Full Document

DREXEL CS 265 - Perl_Part_I_eg

Loading Unlocking...
Login

Join to view Perl_Part_I_eg and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Perl_Part_I_eg and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?