Yurttas/PL/SL/perl/F/03/01/03/a 03.pl
Jump to navigation
Jump to search
1#
2# Copyright(C) 2003
3# All Rights Reserved. Salih Yurttas, ZCubes, BitsOfCode Software Systems, Inc..
4#
5# Permission from use, copy, modify, and distribute this
6# software and its documentation for EDUCATIONAL purposes
7# and without fee is hereby granted provided that this
8# copyright notice appears in all copies.
9#
10# date : January 1, 2003.
11# author : Salih Yurttas.
12#
13# a_03.pl
14#
15
16
17sub add {
18 my ($a) = @_;
19 my $t = 0;
20
21 foreach (@$a) {
22 $t += $_;
23 }
24
25 return $t;
26}
27
28my @g = (1,
29 3);
30
31my $c = add(\@g);
32
33print "c = $c";
34print "\n";