[TT #592][docs] Clarify docs about the case sensitivity of the debugger
[parrot.git] / examples / tutorial / 01_temp_var.pir
blob6c15d6f95ccddbe1c6be7efef86cbedfc04f0c63
1 # Copyright (C) 2007-2009, Parrot Foundation.
2 # $Id$
4 =head1 Simple Variables
6 PIR has two kinds of variables. The most simple kind are
7 Parrot register variables. Register variables are named with
8 a dollar sign followed by a single letter and an integer.
9 The letter corresponds to the type of the variable, I for
10 integer, N for number (float), S for string, and P for PMC
11 (any kind of object).
13 The C<=> symbol can be used to assign a value to one of
14 these register variables.
16 =cut
18 .sub main :main
20     $I0 = 42         # set temp integer var to the integer value 42
22     $N3 = 3.14159    # set temp float var to an approximation of pi
24     $S5 = "Hello"    # set temp string var to "Hello"
26     $P0 = new ['String']
27     $P0 = "Ford"     # set temp PMC var to "Ford"
29     say $I0
31     say $N3
33     say $S5
35     say $P0
37 .end
39 # Local Variables:
40 #   mode: pir
41 #   fill-column: 100
42 # End:
43 # vim: expandtab shiftwidth=4 ft=pir: