Order less relational database assoarr jack dec 2

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: p" • • • • • • • • • • Spring, 2010 关联数组 Hash --% Spring, 2010 Binary op: + - * **(exponentiation) / %(Modulus) Unary op: +var -var ++var --var var++ var-Logical op: && || ! and or not xor Bitwise op: & | ^ >> << ~ Numeric relation: == != < <= > >= <=> String relation: eq ne lt le gt ge cmp Ternary op: a ? b : c Range op: (1..5, "A".."D") String op: . x (小写字母x) Assign: = += -= *= /= %= .= **= x= <<= >>= &= &&= |= ||= ^= • Other: ( ) [ ] { } \(referenct) ->(infix dereference) 4 • Index (or key) is an scalar (usually a string, not only numbers). • Order-less. • Relational database %assoArr = ("Jack", "Dec 2", "Joe", "June 2", "Jane", "Feb 13"); %assoArr = ("Jack"=>"Dec 2", "Joe"=>"June 2", "Jane"=>"Feb 13"); $assoArr{"Marry"} = "Oct 10"; 多数情况下,key串的引号可省略 $assoArr{"Jennifer"} = "Mar 20"; print "Joe's birthday is: " . $assoArr{Joe} . "\n"; =>Joe's birthday is: June 2 %assoArr = (); #empty hash. %hex2bin = (0 => "0000", 1 => "0001", ... , F=>"1111"); $hex = "A19e"; $bin = join("_",map($hex2bin{$_}, split(//,uc $hex))); =>1010_0001_1001_1110 另一种办法: (记住...
View Full Document

This note was uploaded on 04/04/2010 for the course EE INFO130098 taught by Professor Zhou during the Spring '10 term at Fudan University.

Ask a homework question - tutors are online