File: subargs.htm

package info (click to toggle)
libembperl-perl 2.5.0-4
  • links: PTS, VCS
  • area: main
  • in suites: jessie-kfreebsd
  • size: 6,200 kB
  • sloc: ansic: 21,387; perl: 14,496; cpp: 467; xml: 49; makefile: 32; sh: 24
file content (55 lines) | stat: -rwxr-xr-x 558 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55

<html>
<head>
<title>Define a Subroutine with Args within Embperl</title>
</head>

<body>

[$ sub test ($a, $b) $]

a=[+ $a +]
b=[+ $b +]

[$endsub$]


[$ sub test2 ($a, $b) 

$c = $a + $b ;

$]

c=[+ $a +] + [+ $b +] = [+ $c +]

[$endsub$]


[$ sub test3 ($a, $b) 

my $c = ($a - $b) ;

$]

a=[+ $a +]
b=[+ $b +]
c=[+ $c +]

[$endsub$]



1,2->[- test(1,2) -]
3,4->[- test(3,4) -]

1,2->[- test2(1,2) -]
3,4->[- test2(3,4) -]

1,2->[- test3(1,2) -]
3,4->[- test3(3,4) -]
 
<P>Ok.<P>


</body>
</html>