Yurttas/PL/SL/perl/F/03/01/02/a 00.pl

Revision as of 18:57, 7 November 2013 by MassBot1 (talk | contribs) (Created page with "<syntaxhighlight lang="perl" line start="1" enclose="div"># # Copyright(C) 2003 # All Rights Reserved. Salih Yurttas, ZCubes, BitsOfCode Software Systems, Inc.. # # Pe...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
 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_00.pl
14#
15
16
17sub f {
18  my ($a) = @_;
19
20  print "f-0 -\n";
21  foreach (@$a) {
22    print $_, "\n";
23  }
24
25  foreach (@$a) {
26    ++$_;
27  }
28
29  print "f-1 -\n";
30  foreach (@$a) {
31    print $_, "\n";
32  }
33  print "\n";
34
35  return $a;
36}
37
38my @a = (0,
39         2,
40         4,
41         8);
42
43print "m-0 -\n";
44for($i=0; $i<@a; $i++) {
45  print $a[$i], "\n";
46}
47print "\n";
48
49my ($b) = f(\@a);
50
51print "m-1 -\n";
52foreach (@$b) {
53  print $_, "\n";
54}