# unicode is just another aspect
# of "scalar"
binmode(STDOUT, ":utf8");
print u"M\x{0101}ori" # Māori
#arrays
@x = (1, 2, 'three')
push @x, 'IV';
pop @x; # 'IV'
shift @x; # 1
unshift @x, 1;
splice @x, 1, 2, 'f', 'u';
@x[1] = \@x;
@x = sort @x;
|
#unicode has it's own type: unicode
u"unicode literal"
x = unicode('hello world') # u'hello world'
str(x) # 'hello world'
print u"M\u0101ori" # Māori
#lists
x = [1, 2, 'three']
x.append('IV')
x.pop() # 'IV'
x.pop(0) # 1
x.insert(0, 1) # [1, 2, 'three']
x[1:2] = 'fu' # [1, 'f', 'u']
x[1] = x
x.sort() #sorts in place, returns None
|